1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-24 02:50:35 +03:00

track screens count changes for View Settings

This commit is contained in:
Michail Vourlakos 2019-06-17 21:20:46 +03:00
parent 1300c92a8f
commit 396efadb5a
4 changed files with 20 additions and 1 deletions

View File

@ -63,6 +63,9 @@ UniversalSettings::UniversalSettings(KSharedConfig::Ptr config, QObject *parent)
connect(this, &UniversalSettings::versionChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::screenScalesChanged, this, &UniversalSettings::saveScalesConfig);
connect(qGuiApp, &QGuiApplication::screenAdded, this, &UniversalSettings::screensCountChanged);
connect(qGuiApp, &QGuiApplication::screenRemoved, this, &UniversalSettings::screensCountChanged);
}
UniversalSettings::~UniversalSettings()

View File

@ -140,6 +140,7 @@ signals:
void layoutsMemoryUsageChanged();
void metaPressAndHoldEnabledChanged();
void mouseSensitivityChanged();
void screensCountChanged();
void screenScalesChanged();
void screenTrackerIntervalChanged();
void showInfoWindowChanged();

View File

@ -156,7 +156,17 @@ T.ComboBox {
height: textField.height
colorGroup: PlasmaCore.Theme.ButtonColorGroup
source: control.iconRole === "icon" ? control.model.get(control.currentIndex).icon : ''
source: {
if (control && control.currentIndex>=0 &&
control.iconRole && control.iconRole === "icon"
&& control.model && control.model.get(control.currentIndex)
&& control.model.get(control.currentIndex)) {
return control.model.get(control.currentIndex).icon;
}
return "";
}
visible: source !== ''
}

View File

@ -76,6 +76,11 @@ PlasmaComponents.Page {
text: screenRow.visible ? i18n("Screen") : i18n("Location")
}
Connections {
target: universalSettings
onScreensCountChanged: screenRow.updateScreens()
}
RowLayout {
id: screenRow
Layout.fillWidth: true