@@ -75,6 +75,9 @@ void PanelsPane::setCurrentSettings(qint8 panelNumber) {
75
75
// Panel height
76
76
ui->thicknessSpinBox ->setValue (panelsPaneConfig[panelName].toObject ()[" thickness" ].toInt ());
77
77
78
+ // Screen
79
+ ui->screenComboBox ->setCurrentIndex (ui->screenComboBox ->findText (panelsPaneConfig[panelName].toObject ()[" screen" ].toString ()));
80
+
78
81
// Panel location
79
82
if (panelsPaneConfig[panelName].toObject ()[" location" ].toString () == " top" ) {
80
83
ui->topRadioButton ->setChecked (true );
@@ -94,6 +97,9 @@ void PanelsPane::setCurrentSettings(qint8 panelNumber) {
94
97
95
98
// Spacing between applets
96
99
ui->spacingSpinBox ->setValue (panelsPaneConfig[panelName].toObject ()[" spacing" ].toInt ());
100
+
101
+ // Margin
102
+ ui->marginSpinBox ->setValue (panelsPaneConfig[panelName].toObject ()[" margin" ].toInt ());
97
103
}
98
104
99
105
void PanelsPane::saveSettings (qint8 panelNumber) {
@@ -120,6 +126,9 @@ void PanelsPane::saveSettings(qint8 panelNumber) {
120
126
// Panel height
121
127
panelObject[" thickness" ] = QJsonValue (ui->thicknessSpinBox ->value ());
122
128
129
+ // Screen
130
+ panelObject[" screen" ] = QJsonValue (ui->screenComboBox ->currentText ());
131
+
123
132
// Panel location
124
133
if (ui->topRadioButton ->isChecked ()) {
125
134
panelObject[" location" ] = QJsonValue (" top" );
@@ -140,6 +149,9 @@ void PanelsPane::saveSettings(qint8 panelNumber) {
140
149
// Spacing between applets
141
150
panelObject[" spacing" ] = QJsonValue (ui->spacingSpinBox ->value ());
142
151
152
+ // Margin
153
+ panelObject[" margin" ] = QJsonValue (ui->marginSpinBox ->value ());
154
+
143
155
144
156
panelsPaneConfig[panelName] = panelObject;
145
157
Pane::saveConfig (panelsPaneConfig);
@@ -177,6 +189,10 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
177
189
panelsPaneConfig[" accent" ].toString () + \
178
190
" ; color: #ffffff };" );
179
191
192
+ // Screen ComboBox accent
193
+ ui->screenComboBox ->setStyleSheet (" QComboBox { selection-background-color: " + \
194
+ panelsPaneConfig[" accent" ].toString () + " ; }" );
195
+
180
196
// Applet icons
181
197
iconByApplet[" appmenu" ] = " app-launcher" ;
182
198
iconByApplet[" windowlist" ] = " kwin" ;
@@ -211,7 +227,6 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
211
227
nameByApplet[" sni" ] = " SNI tray" ;
212
228
nameByApplet[" clioutput" ] = " CLI Output" ;
213
229
214
-
215
230
for (qint8 i = 0 ; i < ui->availableAppletsListWidget ->count (); ++i) {
216
231
QListWidgetItem* item = ui->availableAppletsListWidget ->item (i);
217
232
item->setIcon (QIcon::fromTheme (iconByApplet[item->text ()]));
@@ -228,6 +243,13 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
228
243
// Set max shift
229
244
ui->shiftSpinBox ->setMaximum (QGuiApplication::primaryScreen ()->geometry ().width ());
230
245
246
+ // Add existing monitors
247
+ QList<QScreen*> screens = QGuiApplication::screens ();
248
+ foreach (QScreen* screen, screens) {
249
+ ui->screenComboBox ->addItem (screen->name ());
250
+ }
251
+
252
+
231
253
// Make connections
232
254
this ->connect (ui->panelsListWidget , &QListWidget::itemClicked, this ,
233
255
[this ]() {
0 commit comments