tray: more flexible overflow menu

This commit is contained in:
end-4
2025-08-21 08:25:28 +07:00
parent eafa8f02b6
commit 4cfacde337
3 changed files with 28 additions and 5 deletions
@@ -10,6 +10,7 @@ LazyLoader {
property Item hoverTarget
default property Item contentItem
property real popupBackgroundMargin: 0
active: hoverTarget && hoverTarget.containsMouse
@@ -22,8 +23,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
implicitHeight: popupBackground.implicitHeight + Appearance.sizes.hyprlandGapsOut * 2
implicitWidth: popupBackground.implicitWidth + Appearance.sizes.hyprlandGapsOut * 2 + root.popupBackgroundMargin
implicitHeight: popupBackground.implicitHeight + Appearance.sizes.hyprlandGapsOut * 2 + root.popupBackgroundMargin
exclusionMode: ExclusionMode.Ignore
exclusiveZone: 0
@@ -62,7 +63,13 @@ LazyLoader {
Rectangle {
id: popupBackground
readonly property real margin: 10
anchors.centerIn: parent
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)
}
implicitWidth: root.contentItem.implicitWidth + margin * 2
implicitHeight: root.contentItem.implicitHeight + margin * 2
color: ColorUtils.applyAlpha(Appearance.colors.colSurfaceContainer, 1 - Appearance.backgroundTransparency)