Skip to content

Commit 6815197

Browse files
committed
0.6.3
1 parent 6cbd531 commit 6815197

File tree

5 files changed

+60
-13
lines changed

5 files changed

+60
-13
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# plainControlCenter
22

33
App that lets you edit config.json more convenient and faster<br><br>
4-
<img src="scr.png">
4+
<img src="scr-0.6.3.png">

panes/panels.cpp

+23-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ void PanelsPane::setCurrentSettings(qint8 panelNumber) {
7575
// Panel height
7676
ui->thicknessSpinBox->setValue(panelsPaneConfig[panelName].toObject()["thickness"].toInt());
7777

78+
// Screen
79+
ui->screenComboBox->setCurrentIndex(ui->screenComboBox->findText(panelsPaneConfig[panelName].toObject()["screen"].toString()));
80+
7881
// Panel location
7982
if (panelsPaneConfig[panelName].toObject()["location"].toString() == "top") {
8083
ui->topRadioButton->setChecked(true);
@@ -94,6 +97,9 @@ void PanelsPane::setCurrentSettings(qint8 panelNumber) {
9497

9598
// Spacing between applets
9699
ui->spacingSpinBox->setValue(panelsPaneConfig[panelName].toObject()["spacing"].toInt());
100+
101+
// Margin
102+
ui->marginSpinBox->setValue(panelsPaneConfig[panelName].toObject()["margin"].toInt());
97103
}
98104

99105
void PanelsPane::saveSettings(qint8 panelNumber) {
@@ -120,6 +126,9 @@ void PanelsPane::saveSettings(qint8 panelNumber) {
120126
// Panel height
121127
panelObject["thickness"] = QJsonValue(ui->thicknessSpinBox->value());
122128

129+
// Screen
130+
panelObject["screen"] = QJsonValue(ui->screenComboBox->currentText());
131+
123132
// Panel location
124133
if (ui->topRadioButton->isChecked()) {
125134
panelObject["location"] = QJsonValue("top");
@@ -140,6 +149,9 @@ void PanelsPane::saveSettings(qint8 panelNumber) {
140149
// Spacing between applets
141150
panelObject["spacing"] = QJsonValue(ui->spacingSpinBox->value());
142151

152+
// Margin
153+
panelObject["margin"] = QJsonValue(ui->marginSpinBox->value());
154+
143155

144156
panelsPaneConfig[panelName] = panelObject;
145157
Pane::saveConfig(panelsPaneConfig);
@@ -177,6 +189,10 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
177189
panelsPaneConfig["accent"].toString() + \
178190
"; color: #ffffff };");
179191

192+
// Screen ComboBox accent
193+
ui->screenComboBox->setStyleSheet("QComboBox { selection-background-color: " + \
194+
panelsPaneConfig["accent"].toString() + "; }");
195+
180196
// Applet icons
181197
iconByApplet["appmenu"] = "app-launcher";
182198
iconByApplet["windowlist"] = "kwin";
@@ -211,7 +227,6 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
211227
nameByApplet["sni"] = "SNI tray";
212228
nameByApplet["clioutput"] = "CLI Output";
213229

214-
215230
for (qint8 i = 0; i < ui->availableAppletsListWidget->count(); ++i) {
216231
QListWidgetItem* item = ui->availableAppletsListWidget->item(i);
217232
item->setIcon(QIcon::fromTheme(iconByApplet[item->text()]));
@@ -228,6 +243,13 @@ PanelsPane::PanelsPane(QWidget *parent, Settings* controlCenter) :
228243
// Set max shift
229244
ui->shiftSpinBox->setMaximum(QGuiApplication::primaryScreen()->geometry().width());
230245

246+
// Add existing monitors
247+
QList<QScreen*> screens = QGuiApplication::screens();
248+
foreach (QScreen* screen, screens) {
249+
ui->screenComboBox->addItem(screen->name());
250+
}
251+
252+
231253
// Make connections
232254
this->connect(ui->panelsListWidget, &QListWidget::itemClicked, this,
233255
[this]() {

panes/panels.ui

+36-11
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@
281281
<string/>
282282
</property>
283283
<property name="icon">
284-
<iconset theme="preferences-system"/>
284+
<iconset theme="preferences-system">
285+
<normaloff>.</normaloff>.</iconset>
285286
</property>
286287
</widget>
287288
</item>
@@ -390,6 +391,16 @@
390391
<property name="spacing">
391392
<number>0</number>
392393
</property>
394+
<item>
395+
<widget class="QLabel" name="screenLabel">
396+
<property name="text">
397+
<string>Screen</string>
398+
</property>
399+
</widget>
400+
</item>
401+
<item>
402+
<widget class="QComboBox" name="screenComboBox"/>
403+
</item>
393404
<item>
394405
<widget class="QLabel" name="locationLabel">
395406
<property name="text">
@@ -399,24 +410,17 @@
399410
</item>
400411
<item>
401412
<layout class="QGridLayout" name="gridLayout">
402-
<item row="1" column="0">
403-
<widget class="QRadioButton" name="bottomRadioButton">
404-
<property name="text">
405-
<string>Bottom</string>
406-
</property>
407-
</widget>
408-
</item>
409413
<item row="0" column="0">
410414
<widget class="QRadioButton" name="topRadioButton">
411415
<property name="text">
412416
<string>Top</string>
413417
</property>
414418
</widget>
415419
</item>
416-
<item row="0" column="1">
417-
<widget class="QRadioButton" name="leftRadioButton">
420+
<item row="1" column="0">
421+
<widget class="QRadioButton" name="bottomRadioButton">
418422
<property name="text">
419-
<string>Left</string>
423+
<string>Bottom</string>
420424
</property>
421425
</widget>
422426
</item>
@@ -427,6 +431,13 @@
427431
</property>
428432
</widget>
429433
</item>
434+
<item row="0" column="1">
435+
<widget class="QRadioButton" name="leftRadioButton">
436+
<property name="text">
437+
<string>Left</string>
438+
</property>
439+
</widget>
440+
</item>
430441
</layout>
431442
</item>
432443
</layout>
@@ -451,6 +462,20 @@
451462
</item>
452463
</layout>
453464
</item>
465+
<item>
466+
<layout class="QHBoxLayout" name="horizontalLayout_7">
467+
<item>
468+
<widget class="QLabel" name="marginLabel">
469+
<property name="text">
470+
<string>Margin</string>
471+
</property>
472+
</widget>
473+
</item>
474+
<item>
475+
<widget class="QSpinBox" name="marginSpinBox"/>
476+
</item>
477+
</layout>
478+
</item>
454479
<item>
455480
<widget class="QPushButton" name="revertPushButton">
456481
<property name="text">

scr-0.6.3.png

99.1 KB
Loading

scr.png

-82.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)