fix: hide system tray when no items present#70
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug where the system tray was not properly hidden when no applications were present in the tray. The fix introduces a hasItems property that checks the Repeater count to determine visibility, and sets the component dimensions to 0 when empty.
Changes:
- Added
hasItemsproperty usingrowRepeater.count > 0to track when system tray items are present - Set
visiblebinding tohasItemsto hide the component when empty - Conditionally set
Layout.preferredWidth,implicitWidth, andimplicitHeightto 0 whenhasItemsis false
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| spacing: 8 | ||
|
|
||
| Repeater { | ||
| id: columnRepeater |
There was a problem hiding this comment.
The columnRepeater ID is added but never used. Since both rowRepeater and columnRepeater share the same model (SystemTray.items), they will always have the same count. The current implementation only checks rowRepeater.count on line 29, making this ID unnecessary. Consider either removing this ID or updating line 29 to check the appropriate repeater based on orientation (e.g., (vertical ? columnRepeater.count : rowRepeater.count) > 0) for clarity.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Fixes Axenide#4 - Added hasItems property using Repeater.count for reliable model counting - Set visible binding to hasItems - Set Layout.preferredWidth/implicitWidth/implicitHeight to 0 when empty - Tray now properly hides when no apps are in the system tray
de2a7aa to
f8b316f
Compare
Fixes #4