bar/activewindow: allow disable show on hover

Closes #1209
Closes #1019
This commit is contained in:
2 * r + 2 * t 2026-03-15 22:29:28 +11:00
parent dc8767e28b
commit 521cd4079e
5 changed files with 22 additions and 3 deletions

View file

@ -333,7 +333,8 @@ default, you must create it manually.
"bar": { "bar": {
"activeWindow": { "activeWindow": {
"compact": false, "compact": false,
"inverted": false "inverted": false,
"showOnHover": true
}, },
"clock": { "clock": {
"showIcon": true "showIcon": true

View file

@ -90,6 +90,7 @@ JsonObject {
component ActiveWindow: JsonObject { component ActiveWindow: JsonObject {
property bool compact: false property bool compact: false
property bool inverted: false property bool inverted: false
property bool showOnHover: true
} }
component Tray: JsonObject { component Tray: JsonObject {

View file

@ -181,7 +181,8 @@ Singleton {
}, },
activeWindow: { activeWindow: {
compact: bar.activeWindow.compact, compact: bar.activeWindow.compact,
inverted: bar.activeWindow.inverted inverted: bar.activeWindow.inverted,
showOnHover: bar.activeWindow.showOnHover
}, },
tray: { tray: {
background: bar.tray.background, background: bar.tray.background,

View file

@ -68,7 +68,7 @@ ColumnLayout {
popouts.hasCurrent = false; popouts.hasCurrent = false;
item.expanded = true; item.expanded = true;
} }
} else if (id === "activeWindow" && Config.bar.popouts.activeWindow) { } else if (id === "activeWindow" && Config.bar.popouts.activeWindow && Config.bar.activeWindow.showOnHover) {
popouts.currentName = id.toLowerCase(); popouts.currentName = id.toLowerCase();
popouts.currentCenter = item.mapToItem(root, 0, itemHeight / 2).y; popouts.currentCenter = item.mapToItem(root, 0, itemHeight / 2).y;
popouts.hasCurrent = true; popouts.hasCurrent = true;
@ -134,6 +134,7 @@ ColumnLayout {
DelegateChoice { DelegateChoice {
roleValue: "activeWindow" roleValue: "activeWindow"
delegate: WrappedLoader { delegate: WrappedLoader {
Layout.fillWidth: true
sourceComponent: ActiveWindow { sourceComponent: ActiveWindow {
bar: root bar: root
monitor: Brightness.getMonitorForScreen(root.screen) monitor: Brightness.getMonitorForScreen(root.screen)

View file

@ -38,6 +38,21 @@ Item {
implicitWidth: Math.max(icon.implicitWidth, current.implicitHeight) implicitWidth: Math.max(icon.implicitWidth, current.implicitHeight)
implicitHeight: icon.implicitHeight + current.implicitWidth + current.anchors.topMargin implicitHeight: icon.implicitHeight + current.implicitWidth + current.anchors.topMargin
Loader {
anchors.fill: parent
active: !Config.bar.activeWindow.showOnHover
sourceComponent: MouseArea {
cursorShape: Qt.PointingHandCursor
onClicked: {
const popouts = root.bar.popouts;
popouts.currentName = "activewindow";
popouts.currentCenter = root.mapToItem(root.bar, 0, root.implicitHeight / 2).y;
popouts.hasCurrent = true;
}
}
}
MaterialIcon { MaterialIcon {
id: icon id: icon