BarWidgets: First pass on contextual widget menu accessible from right-click.

Testing on volume widget for now.
This commit is contained in:
ItsLemmy
2025-11-17 20:35:45 -05:00
parent 1b114a0c5f
commit 3283aacf9b
11 changed files with 452 additions and 124 deletions
+2 -9
View File
@@ -98,13 +98,6 @@ PopupWindow {
}
}
// Full-sized, transparent MouseArea to track the mouse.
MouseArea {
id: rootMouseArea
anchors.fill: parent
hoverEnabled: true
}
Item {
anchors.fill: parent
Keys.onEscapePressed: root.hideMenu()
@@ -186,7 +179,7 @@ PopupWindow {
Rectangle {
id: innerRect
anchors.fill: parent
color: mouseArea.containsMouse ? Color.mTertiary : Color.transparent
color: mouseArea.containsMouse ? Color.mHover : Color.transparent
radius: Style.radiusS
visible: !(modelData?.isSeparator ?? false)
@@ -199,7 +192,7 @@ PopupWindow {
NText {
id: text
Layout.fillWidth: true
color: (modelData?.enabled ?? true) ? (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) : Color.mOnSurfaceVariant
color: (modelData?.enabled ?? true) ? (mouseArea.containsMouse ? Color.mOnHover : Color.mOnSurface) : Color.mOnSurfaceVariant
text: modelData?.text !== "" ? modelData?.text.replace(/[\n\r]+/g, ' ') : "..."
pointSize: Style.fontSizeS
verticalAlignment: Text.AlignVCenter