From 6317af9ee1964a7f636b977541b447cbdfd4eaac Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 17 Feb 2015 12:16:22 -0500 Subject: Fix some panel interactions. 1) Found/fixed a bug with a panel mis-reporting which number it was. 2) Clean up the panel interface management in lumina-config. --- lumina-config/mainUI.cpp | 37 +++++++++++++++++-------------------- lumina-config/mainUI.ui | 24 ++++++++++++------------ 2 files changed, 29 insertions(+), 32 deletions(-) (limited to 'lumina-config') diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index c5a0c934..affa3921 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -810,57 +810,54 @@ void MainUI::panelValChanged(){ void MainUI::addpanel1(){ ui->toolBox_panel1->setVisible(true); + panelnumber = 1; checkpanels(); ui->push_save->setEnabled(true); modpan = true; - panelnumber = 1; } void MainUI::addpanel2(){ ui->toolBox_panel2->setVisible(true); + panelnumber = 2; checkpanels(); ui->push_save->setEnabled(true); modpan = true; - panelnumber = 2; } void MainUI::rmpanel1(){ ui->toolBox_panel1->setVisible(false); + panelnumber = 0; checkpanels(); ui->push_save->setEnabled(true); modpan = true; - panelnumber = 0; } void MainUI::rmpanel2(){ ui->toolBox_panel2->setVisible(false); + panelnumber = 1; checkpanels(); ui->push_save->setEnabled(true); modpan = true; - panelnumber = 1; } void MainUI::checkpanels(){ //This checks the primary panel buttons/visibility - ui->tool_panel1_add->setVisible(!ui->toolBox_panel1->isVisible()); - ui->tool_panel1_rm->setVisible(ui->toolBox_panel1->isVisible()); - if(ui->tool_panel1_add->isVisible()){ - //No panels at all yet - disable the 2nd panel options - ui->tool_panel2_add->setVisible(false); - ui->tool_panel2_rm->setVisible(false); - ui->toolBox_panel2->setVisible(false); - ui->label_panel2->setVisible(false); + //panel 1 + ui->tool_panel1_add->setVisible(panelnumber < 1); + ui->tool_panel1_rm->setVisible(panelnumber == 1); + ui->toolBox_panel1->setVisible(panelnumber>0); + //panel1 label is always visible + //panel 2 + ui->tool_panel2_add->setVisible(panelnumber==1); + ui->tool_panel2_rm->setVisible(panelnumber>1); + ui->toolBox_panel2->setVisible(panelnumber>1); + ui->label_panel2->setVisible(panelnumber>0); + + //Sizing/layout fix for side-by-side vertical layouts + if(panelnumber<1){ ui->gridLayout_panels->setColumnStretch(2,1); - panelnumber = 0; //no panels at the moment }else{ - //Panel 1 is visible - also show options for panel 2 appropriately - ui->tool_panel2_add->setVisible(!ui->toolBox_panel2->isVisible()); - ui->tool_panel2_rm->setVisible(ui->toolBox_panel2->isVisible()); - ui->label_panel2->setVisible(true); - ui->tool_panel1_rm->setVisible(!ui->toolBox_panel2->isVisible()); ui->gridLayout_panels->setColumnStretch(2,0); - if(ui->tool_panel2_add->isVisible()){ panelnumber = 1; } - else{panelnumber = 2; } } } diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui index dcdc4d12..fcebaff7 100644 --- a/lumina-config/mainUI.ui +++ b/lumina-config/mainUI.ui @@ -9,8 +9,8 @@ 0 0 - 579 - 424 + 596 + 442 @@ -109,7 +109,7 @@ QFrame::StyledPanel - 4 + 1 @@ -374,7 +374,7 @@ - 0 + 1 @@ -536,7 +536,7 @@ Panels - + @@ -602,8 +602,8 @@ 0 0 - 233 - 150 + 263 + 178 @@ -799,8 +799,8 @@ 0 0 - 233 - 150 + 263 + 178 @@ -1771,8 +1771,8 @@ 0 0 - 493 - 89 + 128 + 28 @@ -1890,7 +1890,7 @@ 0 0 - 579 + 596 19 -- cgit