forked from Shinonome/dots-hyprland
bar: Filter Variants instead of hiding PanelWindow
This commit is contained in:
@@ -19,16 +19,22 @@ Scope {
|
|||||||
readonly property int osdHideMouseMoveThreshold: 20
|
readonly property int osdHideMouseMoveThreshold: 20
|
||||||
property bool showBarBackground: ConfigOptions.bar.showBackground
|
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
|
Variants { // For each monitor
|
||||||
model: Quickshell.screens
|
model: bar.filteredScreens
|
||||||
|
|
||||||
PanelWindow { // Bar window
|
PanelWindow { // Bar window
|
||||||
id: barRoot
|
id: barRoot
|
||||||
screen: modelData
|
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 ShellScreen modelData
|
||||||
property var brightnessMonitor: Brightness.getMonitorForScreen(modelData)
|
property var brightnessMonitor: Brightness.getMonitorForScreen(modelData)
|
||||||
property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 :
|
property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 :
|
||||||
|
|||||||
Reference in New Issue
Block a user