Standardize bar icon geometry

This commit is contained in:
David Heinemeier Hansson
2026-07-17 15:20:55 -07:00
parent fe48e83222
commit 6e3b69b8da
17 changed files with 272 additions and 124 deletions
+2 -9
View File
@@ -1297,13 +1297,6 @@ Item {
readonly property bool hovered: moduleHover.hovered
readonly property bool dragSource: root.barDragSource === slot
readonly property bool panelOpen: root.activePopout === slot.activeItem
readonly property real openIndicatorInlineOffset: {
var item = slot.activeItem
if (!item || !("openIndicatorInlineOffset" in item)) return 0
var offset = Number(item.openIndicatorInlineOffset)
return isFinite(offset) ? offset : 0
}
implicitWidth: activeItem && activeItem.visible ? (root.vertical ? root.barSize : activeItem.implicitWidth) : 0
implicitHeight: activeItem && activeItem.visible ? activeItem.implicitHeight : 0
width: implicitWidth
@@ -1377,9 +1370,9 @@ Item {
height: root.vertical ? Math.max(Style.space(10), Math.round(parent.height * 0.55)) : Style.space(2)
x: root.vertical
? (root.position === "left" ? parent.width - width - inset : inset)
: (slot.openIndicatorInlineOffset === 0 ? Math.round((parent.width - width) / 2) : (parent.width - width) / 2 + slot.openIndicatorInlineOffset)
: Math.round((parent.width - width) / 2)
y: root.vertical
? (slot.openIndicatorInlineOffset === 0 ? Math.round((parent.height - height) / 2) : (parent.height - height) / 2 + slot.openIndicatorInlineOffset)
? Math.round((parent.height - height) / 2)
: (root.position === "top" ? parent.height - height - inset : inset)
z: 50
+1 -1
View File
@@ -34,7 +34,7 @@ BarWidget {
PwObjectTracker { objects: root.source ? [root.source] : [] }
WidgetButton {
BarIconButton {
id: button
anchors.fill: parent
bar: root.bar
+1 -2
View File
@@ -52,12 +52,11 @@ BarWidget {
onTriggered: root.refresh()
}
WidgetButton {
BarIconButton {
id: button
anchors.fill: parent
bar: root.bar
text: "\uf021"
fontSize: Style.font.caption
tooltipText: ""
onPressed: root.runUpdate()
}
+5 -9
View File
@@ -24,9 +24,9 @@ BarWidget {
readonly property var drawerItems: bucket("drawer")
readonly property var allItems: bucket("all")
readonly property int drawerCount: drawerItems.length
readonly property int trayItemExtent: Style.space(16)
readonly property int trayItemGap: Style.space(9)
readonly property int trayJoinGap: Style.space(4)
readonly property int trayItemExtent: Style.bar.iconSlot
readonly property int trayItemGap: 0
readonly property int trayJoinGap: 0
readonly property int drawerExtent: drawerCount > 0 ? drawerCount * trayItemExtent + (drawerCount - 1) * trayItemGap : 0
// Match Waybar's group/tray-expander drawer transition-duration.
readonly property int animationDuration: 600
@@ -182,15 +182,13 @@ BarWidget {
onHoveredChanged: root.expanded = hovered
}
WidgetButton {
BarIconButton {
id: expandIcon
bar: root.bar
width: implicitWidth
height: implicitHeight
x: root.drawerExtent - root.revealExtent
text: "\uf053"
horizontalMargin: 9
verticalPadding: 6
onPressed: function(button) {
if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen
}
@@ -266,7 +264,7 @@ BarWidget {
onHoveredChanged: root.expanded = hovered
}
WidgetButton {
BarIconButton {
id: expandIcon
bar: root.bar
width: implicitWidth
@@ -274,8 +272,6 @@ BarWidget {
y: root.drawerExtent - root.revealExtent
text: "\uf053"
textRotation: 90
horizontalMargin: 9
verticalPadding: 6
onPressed: function(button) {
if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen
}