From a81acb3dbea5a2752be139130d674c1a1573360f Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 9 Jun 2025 12:51:28 +0200 Subject: [PATCH] overview: cleaner, add back hover effect --- .../backgroundWidgets/BackgroundWidgets.qml | 2 +- .../modules/overview/OverviewWindow.qml | 69 +++++++++---------- .../modules/sidebarRight/SidebarRight.qml | 10 +++ 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/.config/quickshell/modules/backgroundWidgets/BackgroundWidgets.qml b/.config/quickshell/modules/backgroundWidgets/BackgroundWidgets.qml index dea41e08f..970dc8d17 100644 --- a/.config/quickshell/modules/backgroundWidgets/BackgroundWidgets.qml +++ b/.config/quickshell/modules/backgroundWidgets/BackgroundWidgets.qml @@ -23,7 +23,7 @@ Scope { property color colText: ColorUtils.colorWithLightness(Appearance.m3colors.m3primary, (root.dominantColorIsDark ? 0.8 : 0.12)) function updateWidgetPosition(fileContent) { - console.log("[BackgroundWidgets] Updating widget position with content:", fileContent) + // console.log("[BackgroundWidgets] Updating widget position with content:", fileContent) const parsedContent = JSON.parse(fileContent) root.centerX = parsedContent.center_x root.centerY = parsedContent.center_y diff --git a/.config/quickshell/modules/overview/OverviewWindow.qml b/.config/quickshell/modules/overview/OverviewWindow.qml index 15d919f80..1f350b7d4 100644 --- a/.config/quickshell/modules/overview/OverviewWindow.qml +++ b/.config/quickshell/modules/overview/OverviewWindow.qml @@ -45,11 +45,14 @@ Rectangle { // Window width: Math.min(windowData?.size[0] * root.scale, (restrictToWorkspace ? windowData?.size[0] : availableWorkspaceWidth - x + xOffset)) height: Math.min(windowData?.size[1] * root.scale, (restrictToWorkspace ? windowData?.size[1] : availableWorkspaceHeight - y + yOffset)) - radius: Appearance.rounding.windowRounding * root.scale - color: pressed ? Appearance.colors.colLayer2Active : hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2 - border.color : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.9) - border.pixelAligned : false - border.width : 1 + layer.enabled: true + layer.effect: OpacityMask { + maskSource: Rectangle { + width: root.width + height: root.height + radius: Appearance.rounding.windowRounding * root.scale + } + } Behavior on x { animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) @@ -67,44 +70,34 @@ Rectangle { // Window ScreencopyView { anchors.fill: parent captureSource: GlobalStates.overviewOpen ? root.toplevel : null - live: false - } + live: true - ColumnLayout { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.right: parent.right - spacing: Appearance.font.pixelSize.smaller * 0.5 - - IconImage { - id: windowIcon - Layout.alignment: Qt.AlignHCenter - source: root.iconPath - implicitSize: Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) - - Behavior on implicitSize { - animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) - } + Rectangle { + anchors.fill: parent + radius: Appearance.rounding.windowRounding * root.scale + color: pressed ? Appearance.colors.colLayer2Active : hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2 + opacity: pressed ? 0.3 : hovered ? 0.2 : 0 + border.color : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.9) + border.pixelAligned : false + border.width : 1 } - StyledLabel { - Layout.leftMargin: 10 - Layout.rightMargin: 10 - visible: !compactMode - Layout.fillWidth: true - Layout.fillHeight: true + ColumnLayout { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: parent.right + spacing: Appearance.font.pixelSize.smaller * 0.5 - background: Rectangle { - width: parent.width - color: Appearance.colors.colLayer2 - radius: Appearance.rounding.windowRounding * root.scale + IconImage { + id: windowIcon + Layout.alignment: Qt.AlignHCenter + source: root.iconPath + implicitSize: Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio) + + Behavior on implicitSize { + animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) + } } - - horizontalAlignment: Text.AlignHCenter - font.pixelSize: Appearance.font.pixelSize.smaller - font.italic: indicateXWayland ? true : false - elide: Text.ElideRight - text: windowData?.title ?? "" } } } \ No newline at end of file diff --git a/.config/quickshell/modules/sidebarRight/SidebarRight.qml b/.config/quickshell/modules/sidebarRight/SidebarRight.qml index 2bb92723d..8fcdca4c8 100644 --- a/.config/quickshell/modules/sidebarRight/SidebarRight.qml +++ b/.config/quickshell/modules/sidebarRight/SidebarRight.qml @@ -127,6 +127,16 @@ Scope { Layout.fillWidth: true } + QuickToggleButton { + toggled: false + buttonIcon: "restart_alt" + onClicked: { + Quickshell.reload(true) + } + StyledToolTip { + content: qsTr("Reload") + } + } QuickToggleButton { toggled: false buttonIcon: "power_settings_new"