diff options
| author | Bora Gülerman <49169566+eratoriele@users.noreply.github.com> | 2026-03-15 10:42:34 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-15 18:42:34 +1100 |
| commit | aea2ac96ef9a6817fe9e81867da202eed4daba90 (patch) | |
| tree | 8ae741a72e1c6e5dd626c40f23d9d1290effef73 /modules/controlcenter/taskbar/TaskbarPane.qml | |
| parent | config: don't serialise sizes (diff) | |
| download | caelestia-shell-aea2ac96ef9a6817fe9e81867da202eed4daba90.tar.gz caelestia-shell-aea2ac96ef9a6817fe9e81867da202eed4daba90.tar.bz2 caelestia-shell-aea2ac96ef9a6817fe9e81867da202eed4daba90.zip | |
controlcenter/taskbar: add excludedScreens (#1215)
also changed controlcenter/components/ConnectedButtonGroup
- Changed row layout to grid layout
- Added optional prop: row, which defaults to 1 so it looks same as
row layout if not given
- added new field to options, which bypasses rootItem bind. This is
needed because we can not predict the number of monitors the user has,
and can not create a seperate variable for each one
Diffstat (limited to 'modules/controlcenter/taskbar/TaskbarPane.qml')
| -rw-r--r-- | modules/controlcenter/taskbar/TaskbarPane.qml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/controlcenter/taskbar/TaskbarPane.qml b/modules/controlcenter/taskbar/TaskbarPane.qml index 9c999e5..6c6b5e5 100644 --- a/modules/controlcenter/taskbar/TaskbarPane.qml +++ b/modules/controlcenter/taskbar/TaskbarPane.qml @@ -46,6 +46,8 @@ Item { property bool popoutActiveWindow: Config.bar.popouts.activeWindow ?? true property bool popoutTray: Config.bar.popouts.tray ?? true property bool popoutStatusIcons: Config.bar.popouts.statusIcons ?? true + property list<string> monitorNames: Hypr.monitorNames() + property list<string> excludedScreens: Config.bar.excludedScreens ?? [] anchors.fill: parent @@ -90,6 +92,7 @@ Item { Config.bar.popouts.activeWindow = root.popoutActiveWindow; Config.bar.popouts.tray = root.popoutTray; Config.bar.popouts.statusIcons = root.popoutStatusIcons; + Config.bar.excludedScreens = root.excludedScreens; const entries = []; for (let i = 0; i < entriesModel.count; i++) { @@ -677,6 +680,43 @@ Item { ] } } + + SectionContainer { + Layout.fillWidth: true + alignTop: true + + StyledText { + text: qsTr("Monitors") + font.pointSize: Appearance.font.size.normal + } + + ConnectedButtonGroup { + rootItem: root + // max 3 options per line + rows: Math.ceil(root.monitorNames.length / 3) + + options: root.monitorNames.map(e => ({ + label: qsTr(e), + propertyName: `monitor${e}`, + onToggled: function (_) { + // if the given monitor is in the excluded list, it should be added back + let addedBack = excludedScreens.includes(e) + if (addedBack) { + const index = excludedScreens.indexOf(e); + if (index !== -1) { + excludedScreens.splice(index, 1); + } + } else { + if (!excludedScreens.includes(e)) { + excludedScreens.push(e); + } + } + root.saveConfig(); + }, + state: !Strings.testRegexList(root.excludedScreens, e) + })) + } + } } } } |