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:
parent
1300c92a8f
commit
396efadb5a
@ -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()
|
||||
|
@ -140,6 +140,7 @@ signals:
|
||||
void layoutsMemoryUsageChanged();
|
||||
void metaPressAndHoldEnabledChanged();
|
||||
void mouseSensitivityChanged();
|
||||
void screensCountChanged();
|
||||
void screenScalesChanged();
|
||||
void screenTrackerIntervalChanged();
|
||||
void showInfoWindowChanged();
|
||||
|
@ -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 !== ''
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user