From de6969f561570d93c9bf161613a833ef860784a6 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 28 Sep 2025 14:03:18 +0200 Subject: [PATCH] bar: fix tooltip shadow cutoff, use fewer Layouts --- .../ii/modules/bar/BatteryPopup.qml | 4 ++- .../ii/modules/bar/ClockWidgetTooltip.qml | 12 ++++---- .../ii/modules/bar/ResourcesPopup.qml | 28 +++++++++++-------- .../quickshell/ii/modules/bar/StyledPopup.qml | 12 ++++---- .../ii/modules/verticalBar/VerticalMedia.qml | 10 +++++-- 5 files changed, 39 insertions(+), 27 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/BatteryPopup.qml b/.config/quickshell/ii/modules/bar/BatteryPopup.qml index c697bfbda..1f96155e0 100644 --- a/.config/quickshell/ii/modules/bar/BatteryPopup.qml +++ b/.config/quickshell/ii/modules/bar/BatteryPopup.qml @@ -14,11 +14,12 @@ StyledPopup { spacing: 4 // Header - RowLayout { + Row { id: header spacing: 5 MaterialSymbol { + anchors.verticalCenter: parent.verticalCenter fill: 0 font.weight: Font.Medium text: "battery_android_full" @@ -27,6 +28,7 @@ StyledPopup { } StyledText { + anchors.verticalCenter: parent.verticalCenter text: "Battery" font { weight: Font.Medium diff --git a/.config/quickshell/ii/modules/bar/ClockWidgetTooltip.qml b/.config/quickshell/ii/modules/bar/ClockWidgetTooltip.qml index b2e0165ac..de6ad0935 100644 --- a/.config/quickshell/ii/modules/bar/ClockWidgetTooltip.qml +++ b/.config/quickshell/ii/modules/bar/ClockWidgetTooltip.qml @@ -39,10 +39,11 @@ StyledPopup { spacing: 4 // Date + Time row - RowLayout { + Row { spacing: 5 MaterialSymbol { + anchors.verticalCenter: parent.verticalCenter fill: 0 font.weight: Font.Medium text: "calendar_month" @@ -50,6 +51,7 @@ StyledPopup { color: Appearance.colors.colOnSurfaceVariant } StyledText { + anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Text.AlignLeft color: Appearance.colors.colOnSurfaceVariant text: `${root.formattedDate}` @@ -79,26 +81,26 @@ StyledPopup { } // Tasks - ColumnLayout { + Column { spacing: 0 Layout.fillWidth: true - RowLayout { + Row { spacing: 4 - Layout.fillWidth: true MaterialSymbol { + anchors.verticalCenter: parent.verticalCenter text: "checklist" color: Appearance.colors.colOnSurfaceVariant font.pixelSize: Appearance.font.pixelSize.large } StyledText { + anchors.verticalCenter: parent.verticalCenter text: Translation.tr("To Do:") color: Appearance.colors.colOnSurfaceVariant } } StyledText { - Layout.fillWidth: true horizontalAlignment: Text.AlignLeft wrapMode: Text.Wrap color: Appearance.colors.colOnSurfaceVariant diff --git a/.config/quickshell/ii/modules/bar/ResourcesPopup.qml b/.config/quickshell/ii/modules/bar/ResourcesPopup.qml index 2c694de1e..6aeedf76a 100644 --- a/.config/quickshell/ii/modules/bar/ResourcesPopup.qml +++ b/.config/quickshell/ii/modules/bar/ResourcesPopup.qml @@ -20,7 +20,6 @@ StyledPopup { required property string label required property string value spacing: 4 - Layout.fillWidth: true MaterialSymbol { text: resourceItem.icon @@ -40,13 +39,14 @@ StyledPopup { } } - component ResourceHeaderItem: RowLayout { + component ResourceHeaderItem: Row { id: headerItem required property var icon required property var label spacing: 5 MaterialSymbol { + anchors.verticalCenter: parent.verticalCenter fill: 0 font.weight: Font.Medium text: headerItem.icon @@ -55,6 +55,7 @@ StyledPopup { } StyledText { + anchors.verticalCenter: parent.verticalCenter text: headerItem.label font { weight: Font.Medium @@ -64,19 +65,20 @@ StyledPopup { } } - RowLayout { + Row { anchors.centerIn: parent spacing: 12 - ColumnLayout { - Layout.alignment: Qt.AlignTop + Column { + anchors.top: parent.top spacing: 8 ResourceHeaderItem { icon: "memory" label: "RAM" } - ColumnLayout { + Column { + spacing: 4 ResourceItem { icon: "clock_loader_60" label: Translation.tr("Used:") @@ -95,16 +97,17 @@ StyledPopup { } } - ColumnLayout { + Column { visible: ResourceUsage.swapTotal > 0 - Layout.alignment: Qt.AlignTop + anchors.top: parent.top spacing: 8 ResourceHeaderItem { icon: "swap_horiz" label: "Swap" } - ColumnLayout { + Column { + spacing: 4 ResourceItem { icon: "clock_loader_60" label: Translation.tr("Used:") @@ -123,15 +126,16 @@ StyledPopup { } } - ColumnLayout { - Layout.alignment: Qt.AlignTop + Column { + anchors.top: parent.top spacing: 8 ResourceHeaderItem { icon: "planner_review" label: "CPU" } - ColumnLayout { + Column { + spacing: 4 ResourceItem { icon: "bolt" label: Translation.tr("Load:") diff --git a/.config/quickshell/ii/modules/bar/StyledPopup.qml b/.config/quickshell/ii/modules/bar/StyledPopup.qml index 68ba609e2..9b030685f 100644 --- a/.config/quickshell/ii/modules/bar/StyledPopup.qml +++ b/.config/quickshell/ii/modules/bar/StyledPopup.qml @@ -24,8 +24,8 @@ LazyLoader { anchors.top: Config.options.bar.vertical || (!Config.options.bar.vertical && !Config.options.bar.bottom) anchors.bottom: !Config.options.bar.vertical && Config.options.bar.bottom - implicitWidth: popupBackground.implicitWidth + Appearance.sizes.hyprlandGapsOut * 2 + root.popupBackgroundMargin - implicitHeight: popupBackground.implicitHeight + Appearance.sizes.hyprlandGapsOut * 2 + root.popupBackgroundMargin + implicitWidth: popupBackground.implicitWidth + Appearance.sizes.elevationMargin * 2 + root.popupBackgroundMargin + implicitHeight: popupBackground.implicitHeight + Appearance.sizes.elevationMargin * 2 + root.popupBackgroundMargin mask: Region { item: popupBackground @@ -63,10 +63,10 @@ LazyLoader { readonly property real margin: 10 anchors { fill: parent - leftMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.left) - rightMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.right) - topMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.top) - bottomMargin: Appearance.sizes.hyprlandGapsOut + root.popupBackgroundMargin * (!popupWindow.anchors.bottom) + leftMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.left) + rightMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.right) + topMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.top) + bottomMargin: Appearance.sizes.elevationMargin + root.popupBackgroundMargin * (!popupWindow.anchors.bottom) } implicitWidth: root.contentItem.implicitWidth + margin * 2 implicitHeight: root.contentItem.implicitHeight + margin * 2 diff --git a/.config/quickshell/ii/modules/verticalBar/VerticalMedia.qml b/.config/quickshell/ii/modules/verticalBar/VerticalMedia.qml index 1be93d4a7..24eed8b4f 100644 --- a/.config/quickshell/ii/modules/verticalBar/VerticalMedia.qml +++ b/.config/quickshell/ii/modules/verticalBar/VerticalMedia.qml @@ -70,12 +70,15 @@ MouseArea { hoverTarget: root active: GlobalStates.mediaControlsOpen ? false : root.containsMouse - ColumnLayout { + Column { anchors.centerIn: parent - RowLayout { - spacing: 5 + spacing: 4 + + Row { + spacing: 4 MaterialSymbol { + anchors.verticalCenter: parent.verticalCenter fill: 0 font.weight: Font.Medium text: "music_note" @@ -84,6 +87,7 @@ MouseArea { } StyledText { + anchors.verticalCenter: parent.verticalCenter text: "Media" font { weight: Font.Medium