MainScreen: Bar content is in its own PanelWindow

This commit is contained in:
ItsLemmy
2025-11-09 11:25:06 -05:00
parent d9ca5cdd3a
commit 15539e1445
8 changed files with 221 additions and 34 deletions
@@ -56,6 +56,7 @@ Item {
BarBackground {
bar: root.bar
shapeContainer: backgroundsShape
windowRoot: root.windowRoot
}
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Shapes
import qs.Commons
import qs.Services.UI
import qs.Modules.MainScreen.Backgrounds
@@ -25,6 +26,24 @@ ShapePath {
// Required reference to AllBackgrounds shapeContainer
required property var shapeContainer
// Required reference to windowRoot for screen access
required property var windowRoot
// Check if bar should be visible on this screen
readonly property bool shouldShowBar: {
// Check global bar visibility
if (!BarService.isVisible)
return false
// Check screen-specific configuration
var monitors = Settings.data.bar.monitors || []
var screenName = windowRoot?.screen?.name || ""
// If no monitors specified, show on all screens
// If monitors specified, only show if this screen is in the list
return monitors.length === 0 || monitors.includes(screenName)
}
// Corner radius (from Style)
readonly property real radius: Style.radiusL
@@ -64,7 +83,7 @@ ShapePath {
// ShapePath configuration
strokeWidth: -1 // No stroke, fill only
fillColor: Qt.alpha(Color.mSurface, Settings.data.bar.backgroundOpacity)
fillColor: shouldShowBar ? Qt.alpha(Color.mSurface, Settings.data.bar.backgroundOpacity) : Color.transparent
// Starting position (top-left corner, after the arc)
// Use mapped coordinates relative to the Shape container