forked from Shinonome/dots-hyprland
bar tooltips: add shadow
This commit is contained in:
@@ -4,6 +4,7 @@ import qs.modules.common.widgets
|
|||||||
import qs.services
|
import qs.services
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Effects
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
|
|
||||||
@@ -25,29 +26,37 @@ LazyLoader {
|
|||||||
anchors.top: !Config.options.bar.bottom
|
anchors.top: !Config.options.bar.bottom
|
||||||
anchors.bottom: Config.options.bar.bottom
|
anchors.bottom: Config.options.bar.bottom
|
||||||
|
|
||||||
implicitWidth: popupBackground.implicitWidth
|
implicitWidth: popupBackground.implicitWidth + Appearance.sizes.hyprlandGapsOut * 2
|
||||||
implicitHeight: popupBackground.implicitHeight
|
implicitHeight: popupBackground.implicitHeight + Appearance.sizes.hyprlandGapsOut * 2
|
||||||
|
|
||||||
margins {
|
margins {
|
||||||
left: root.QsWindow?.mapFromItem(
|
left: root.QsWindow?.mapFromItem(
|
||||||
root.hoverTarget,
|
root.hoverTarget,
|
||||||
(root.hoverTarget.width - popupBackground.implicitWidth) / 2, 0
|
(root.hoverTarget.width - popupBackground.implicitWidth) / 2, 0
|
||||||
).x
|
).x
|
||||||
top: Appearance.sizes.hyprlandGapsOut
|
|
||||||
bottom: Appearance.sizes.hyprlandGapsOut
|
|
||||||
}
|
}
|
||||||
WlrLayershell.namespace: "quickshell:popup"
|
WlrLayershell.namespace: "quickshell:popup"
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
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 {
|
Rectangle {
|
||||||
id: popupBackground
|
id: popupBackground
|
||||||
readonly property real margin: 10
|
readonly property real margin: 10
|
||||||
color: Appearance.colors.colSurfaceContainer
|
anchors.centerIn: parent
|
||||||
radius: Appearance.rounding.small
|
|
||||||
|
|
||||||
implicitWidth: root.contentItem.implicitWidth + margin * 2
|
implicitWidth: root.contentItem.implicitWidth + margin * 2
|
||||||
implicitHeight: root.contentItem.implicitHeight + margin * 2
|
implicitHeight: root.contentItem.implicitHeight + margin * 2
|
||||||
|
color: Appearance.colors.colSurfaceContainer
|
||||||
|
radius: Appearance.rounding.small
|
||||||
children: [root.contentItem]
|
children: [root.contentItem]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user