From b0deecc0aadf9d4b62bba7889ee53774f52f2526 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 11 Aug 2025 21:18:01 +0700 Subject: [PATCH] bar tooltips: add shadow --- .../ii/modules/common/widgets/StyledPopup.qml | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.config/quickshell/ii/modules/common/widgets/StyledPopup.qml b/.config/quickshell/ii/modules/common/widgets/StyledPopup.qml index 028e0033d..abe080451 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledPopup.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledPopup.qml @@ -4,6 +4,7 @@ import qs.modules.common.widgets import qs.services import QtQuick import QtQuick.Layouts +import QtQuick.Effects import Quickshell import Quickshell.Wayland @@ -25,29 +26,37 @@ LazyLoader { anchors.top: !Config.options.bar.bottom anchors.bottom: Config.options.bar.bottom - implicitWidth: popupBackground.implicitWidth - implicitHeight: popupBackground.implicitHeight + implicitWidth: popupBackground.implicitWidth + Appearance.sizes.hyprlandGapsOut * 2 + implicitHeight: popupBackground.implicitHeight + Appearance.sizes.hyprlandGapsOut * 2 margins { left: root.QsWindow?.mapFromItem( root.hoverTarget, (root.hoverTarget.width - popupBackground.implicitWidth) / 2, 0 ).x - top: Appearance.sizes.hyprlandGapsOut - bottom: Appearance.sizes.hyprlandGapsOut } WlrLayershell.namespace: "quickshell:popup" WlrLayershell.layer: WlrLayer.Overlay + RectangularShadow { + property var target: popupBackground + anchors.fill: target + radius: target.radius + blur: 0.9 * Appearance.sizes.hyprlandGapsOut + offset: Qt.vector2d(0.0, 1.0) + spread: 0.7 + color: Appearance.colors.colShadow + cached: true + } + Rectangle { id: popupBackground readonly property real margin: 10 - color: Appearance.colors.colSurfaceContainer - radius: Appearance.rounding.small - + anchors.centerIn: parent implicitWidth: root.contentItem.implicitWidth + margin * 2 implicitHeight: root.contentItem.implicitHeight + margin * 2 - + color: Appearance.colors.colSurfaceContainer + radius: Appearance.rounding.small children: [root.contentItem] } }