bar: Filter Variants instead of hiding PanelWindow

This commit is contained in:
_xB
2025-06-12 09:22:22 +03:00
committed by GitHub
parent 2087ea72f8
commit fc157dd709
+10 -4
View File
@@ -19,16 +19,22 @@ Scope {
readonly property int osdHideMouseMoveThreshold: 20
property bool showBarBackground: ConfigOptions.bar.showBackground
// Check screensList from config, If no screens are specified, show on all screens
property var filteredScreens: {
const list = ConfigOptions.bar.screensList;
if (!list || list.length === 0)
return Quickshell.screens;
return Quickshell.screens.filter(screen => list.includes(screen.name));
}
Variants { // For each monitor
model: Quickshell.screens
model: bar.filteredScreens
PanelWindow { // Bar window
id: barRoot
screen: modelData
// Check screensList from config, If no screens are specified, show on all screens
visible: ConfigOptions.bar.screensList.includes(modelData.name) || ConfigOptions.bar.screensList.length === 0
property ShellScreen modelData
property var brightnessMonitor: Brightness.getMonitorForScreen(modelData)
property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 :