Merge pull request #470 from lonerOrz/fix/active-window-layout

fix(bar): Correct ActiveWindow layout when empty
This commit is contained in:
Lemmy
2025-10-13 08:59:59 -04:00
committed by GitHub
11 changed files with 103 additions and 58 deletions
+5 -3
View File
@@ -30,7 +30,7 @@ Item {
return {}
}
readonly property bool hasActiveWindow: CompositorService.getFocusedWindowTitle() !== ""
readonly property bool hasFocusedWindow: CompositorService.getFocusedWindow() !== null
readonly property string windowTitle: CompositorService.getFocusedWindowTitle() || "No active window"
readonly property string fallbackIcon: "user-desktop"
@@ -38,14 +38,16 @@ Item {
// Widget settings - matching MediaMini pattern
readonly property bool showIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : widgetMetadata.showIcon
readonly property bool autoHide: (widgetSettings.autoHide !== undefined) ? widgetSettings.autoHide : widgetMetadata.autoHide
readonly property string hideMode: (widgetSettings.hideMode !== undefined) ? widgetSettings.hideMode : widgetMetadata.hideMode
readonly property string scrollingMode: (widgetSettings.scrollingMode !== undefined) ? widgetSettings.scrollingMode : (widgetMetadata.scrollingMode !== undefined ? widgetMetadata.scrollingMode : "hover")
readonly property int widgetWidth: (widgetSettings.width !== undefined) ? widgetSettings.width : Math.max(widgetMetadata.width, screen.width * 0.06)
implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Style.barHeight) : 0
implicitWidth: visible ? ((barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : (widgetWidth)) : 0
opacity: !autoHide || hasActiveWindow ? 1.0 : 0
// "visible": Always Visible, "hidden": Hide When Empty, "transparent": Transparent When Empty
visible: hideMode !== "hidden" || hasFocusedWindow
opacity: hideMode !== "transparent" || hasFocusedWindow ? 1.0 : 0
Behavior on opacity {
NumberAnimation {
duration: Style.animationNormal