diff options
author | Ken Moore <ken@pcbsd.org> | 2015-02-17 12:16:22 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-02-17 12:16:22 -0500 |
commit | 6317af9ee1964a7f636b977541b447cbdfd4eaac (patch) | |
tree | aa52ad31c08cd8b8e920b29e218538b6f3b8892d /lumina-config/mainUI.cpp | |
parent | Add the ability to "reset" an application back to defaults in lumina-config -... (diff) | |
download | lumina-6317af9ee1964a7f636b977541b447cbdfd4eaac.tar.gz lumina-6317af9ee1964a7f636b977541b447cbdfd4eaac.tar.bz2 lumina-6317af9ee1964a7f636b977541b447cbdfd4eaac.zip |
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.
Diffstat (limited to 'lumina-config/mainUI.cpp')
-rw-r--r-- | lumina-config/mainUI.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
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; } } } |