From 60858f6f02fb7dc04e727db89090e7b83399803a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 11 May 2025 23:55:05 +1000 Subject: feat: session menu --- modules/osd/Osd.qml | 71 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 30 deletions(-) (limited to 'modules/osd/Osd.qml') diff --git a/modules/osd/Osd.qml b/modules/osd/Osd.qml index 8f93ae9..7774bab 100644 --- a/modules/osd/Osd.qml +++ b/modules/osd/Osd.qml @@ -80,49 +80,60 @@ Variants { Component.onCompleted: root.winHeight = height - Background { - id: bg - - visible: false - + Item { anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right + anchors.rightMargin: Drawers.rightExclusion - wrapperWidth: Math.min(wrapper.width, content.width) - wrapperHeight: wrapper.height - } + clip: true + visible: width > 0 + implicitWidth: wrapper.width + implicitHeight: wrapper.height - LayerShadow { - source: bg - } + Background { + id: bg - Wrapper { - id: wrapper + visible: false - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right - implicitHeight: content.height + bg.rounding * 2 + wrapperWidth: Math.min(wrapper.width, content.width) + wrapperHeight: wrapper.height + } - osdVisible: root.osdVisible - contentWidth: content.width + LayerShadow { + source: bg + } + + Wrapper { + id: wrapper + + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right - Content { - id: content + implicitHeight: content.height + bg.rounding * 2 - monitor: root.monitor + osdVisible: root.osdVisible + contentWidth: content.width + + Content { + id: content + + monitor: root.monitor + } } - } - HoverHandler { - id: hoverHandler + HoverHandler { + id: hoverHandler - onHoveredChanged: { - root.hovered = hovered; - if (hovered) - timer.stop(); - else - root.osdVisible = false; + onHoveredChanged: { + root.hovered = hovered; + if (hovered) + timer.stop(); + else + root.osdVisible = false; + } } } } -- cgit v1.2.3-freya