tray: work around qt compiled binding bug on visible via indirection
This commit is contained in:
parent
dde0b73ca5
commit
35f880b563
1 changed files with 8 additions and 7 deletions
|
|
@ -10,27 +10,28 @@ import "../services" as S
|
|||
M.BarModule {
|
||||
id: root
|
||||
spacing: S.Theme.moduleSpacing + 2
|
||||
visible: S.Modules.tray.enable && _trayRepeater.count > 0
|
||||
cursorShape: Qt.ArrowCursor
|
||||
|
||||
// Workaround: Qt 6 compiled bindings break on `visible` when the expression
|
||||
// references Repeater.count on a Row-derived component. The binding silently
|
||||
// dies (imperative overwrite by the engine) and never re-evaluates. Routing
|
||||
// through a custom property forces the interpreted binding path, which works.
|
||||
property bool _shouldBeVisible: S.Modules.tray.enable && _trayRepeater.count > 0
|
||||
visible: _shouldBeVisible
|
||||
|
||||
required property var bar
|
||||
property var _activeMenu: null
|
||||
|
||||
// Shadow binding to test if QML dependency tracking works on a fresh property
|
||||
property bool _shouldBeVisible: S.Modules.tray.enable && _trayRepeater.count > 0
|
||||
// --- debug logging (remove once tray is confirmed working) ---
|
||||
on_ShouldBeVisibleChanged: console.log("[TrayModule] _shouldBeVisible:", _shouldBeVisible, "actual visible:", visible)
|
||||
|
||||
Component.onCompleted: console.log("[TrayModule] created, enable:", S.Modules.tray.enable, "repeater count:", _trayRepeater.count)
|
||||
|
||||
onVisibleChanged: console.log("[TrayModule] visible:", visible, "enable:", S.Modules.tray.enable, "count:", _trayRepeater.count)
|
||||
|
||||
Connections {
|
||||
target: _trayRepeater
|
||||
function onCountChanged() {
|
||||
console.log("[TrayModule] repeater count:", _trayRepeater.count, "visible:", root.visible, "shouldBe:", S.Modules.tray.enable && _trayRepeater.count > 0);
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SystemTray.items
|
||||
function onValuesChanged() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue