bar: minor code changes

This commit is contained in:
2 * r + 2 * t 2025-04-29 22:01:12 +10:00
parent 7358e10bcb
commit 7d07f8175d
2 changed files with 5 additions and 3 deletions

View file

@ -84,7 +84,7 @@ Item {
StatusIcons { StatusIcons {
anchors.left: root.get(tray.right, undefined) anchors.left: root.get(tray.right, undefined)
anchors.leftMargin: root.get(Appearance.padding.normal, 0) anchors.leftMargin: root.get(Appearance.padding.large, 0)
anchors.top: root.get(undefined, tray.bottom) anchors.top: root.get(undefined, tray.bottom)
anchors.topMargin: root.get(0, Appearance.padding.large) anchors.topMargin: root.get(0, Appearance.padding.large)

View file

@ -10,6 +10,7 @@ import Qt5Compat.GraphicalEffects
StyledRect { StyledRect {
animate: true animate: true
clip: true clip: true
visible: width > 0 && height > 0 // To avoid warnings about being visible with no size
BoxLayout { BoxLayout {
Repeater { Repeater {
@ -21,8 +22,8 @@ StyledRect {
required property SystemTrayItem modelData required property SystemTrayItem modelData
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
width: Math.round(Appearance.font.size.large * 1.2) width: Appearance.font.size.smaller * 2
height: Math.round(Appearance.font.size.large * 1.2) height: Appearance.font.size.smaller * 2
onClicked: event => { onClicked: event => {
if (event.button === Qt.LeftButton) if (event.button === Qt.LeftButton)
@ -31,6 +32,7 @@ StyledRect {
menu.open(); menu.open();
} }
// TODO custom menu
QsMenuAnchor { QsMenuAnchor {
id: menu id: menu