diff options
-rw-r--r-- | lumina-config/mainUI.cpp | 37 | ||||
-rw-r--r-- | lumina-config/mainUI.ui | 24 | ||||
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 8 | ||||
-rw-r--r-- | lumina-desktop/LPanel.cpp | 1 | ||||
-rw-r--r-- | lumina-desktop/LPanel.h | 3 |
5 files changed, 37 insertions, 36 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; } } } 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 @@ <rect> <x>0</x> <y>0</y> - <width>579</width> - <height>424</height> + <width>596</width> + <height>442</height> </rect> </property> <property name="windowTitle"> @@ -109,7 +109,7 @@ <enum>QFrame::StyledPanel</enum> </property> <property name="currentIndex"> - <number>4</number> + <number>1</number> </property> <widget class="QWidget" name="page_desktop"> <layout class="QVBoxLayout" name="verticalLayout_3"> @@ -374,7 +374,7 @@ <item> <widget class="QTabWidget" name="tabWidget_panels"> <property name="currentIndex"> - <number>0</number> + <number>1</number> </property> <widget class="QWidget" name="tab_desktopInterface"> <attribute name="title"> @@ -536,7 +536,7 @@ <attribute name="title"> <string>Panels</string> </attribute> - <layout class="QGridLayout" name="gridLayout_panels"> + <layout class="QGridLayout" name="gridLayout_panels" rowstretch="0,1" columnstretch="0,0"> <item row="0" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_9"> <item> @@ -602,8 +602,8 @@ <rect> <x>0</x> <y>0</y> - <width>233</width> - <height>150</height> + <width>263</width> + <height>178</height> </rect> </property> <attribute name="label"> @@ -799,8 +799,8 @@ <rect> <x>0</x> <y>0</y> - <width>233</width> - <height>150</height> + <width>263</width> + <height>178</height> </rect> </property> <attribute name="label"> @@ -1771,8 +1771,8 @@ <rect> <x>0</x> <y>0</y> - <width>493</width> - <height>89</height> + <width>128</width> + <height>28</height> </rect> </property> <property name="sizePolicy"> @@ -1890,7 +1890,7 @@ <rect> <x>0</x> <y>0</y> - <width>579</width> + <width>596</width> <height>19</height> </rect> </property> diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index b119781e..3fbb15f0 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -388,7 +388,9 @@ void LDesktop::UpdatePanels(){ if(panels==-1 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop //Remove all extra panels for(int i=0; i<PANELS.length(); i++){ + qDebug() << " -- panel:" << i << PANELS[i]->number(); if(panels <= PANELS[i]->number()){ + if(DEBUG){ qDebug() << " -- Remove Panel:" << PANELS[i]->number(); } delete PANELS.takeAt(i); i--; } @@ -396,12 +398,12 @@ void LDesktop::UpdatePanels(){ for(int i=0; i<panels; i++){ //Check for a panel with this number bool found = false; - for(int p=0; p<PANELS.length(); p++){ + for(int p=0; p<PANELS.length() && !found; p++){ if(PANELS[p]->number() == i){ found = true; - //qDebug() << " -- Update panel "<< i; + if(DEBUG){ qDebug() << " -- Update panel "<< i; } //panel already exists - just update it - QTimer::singleShot(0, PANELS[i], SLOT(UpdatePanel()) ); + QTimer::singleShot(0, PANELS[p], SLOT(UpdatePanel()) ); } } if(!found){ diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp index 09ddb412..9bb42ae6 100644 --- a/lumina-desktop/LPanel.cpp +++ b/lumina-desktop/LPanel.cpp @@ -20,6 +20,7 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){ tmp->addWidget(panelArea); settings = file; screennum = scr; + panelnum = num; //save for later screen = LSession::desktop(); PPREFIX = "panel"+QString::number(screennum)+"."+QString::number(num)+"/"; defaultpanel = (screen->screenGeometry(screennum).x()==0 && num==0); diff --git a/lumina-desktop/LPanel.h b/lumina-desktop/LPanel.h index 29911127..b7b89d71 100644 --- a/lumina-desktop/LPanel.h +++ b/lumina-desktop/LPanel.h @@ -38,6 +38,7 @@ private: QPoint hidepoint, showpoint; //for hidden panels: locations when hidden/visible bool defaultpanel, horizontal, hidden; int screennum; + int panelnum; QList<LPPlugin*> PLUGINS; public: @@ -45,7 +46,7 @@ public: ~LPanel(); int number(){ - return PPREFIX.section(".",-1).toInt(); + return panelnum; } public slots: |