Normalize bar icon size and alignment

This commit is contained in:
Bjarne Oeverli committed 2026-10-11 21:39:17 +02:00
1 parent e71a816e90
commit 201de1c0d6
17 files changed
+540 -116

No files matched your search

+10
View File
@@ -78,6 +78,16 @@ The `omarchy.indicators` widget loads individual bar indicators from `indicators
All widgets work in `top`, `bottom`, `left`, and `right` positions. Popups anchor on the side opposite the bar edge, sliding into the workspace. Vertical bars use 28px width; widgets that show text fall back to compact icon-only forms (e.g. `media` hides its scrolling label).
## Icon geometry
Use `BarIconButton` from `qs.Ui` for bar icons. It fits the visible glyph bounds to `Style.bar.iconSize` and centers them on both axes. It preserves each glyph's aspect ratio. Set `labelText` for an adjacent text label, such as the battery percentage.
The `[bar]` section of a theme's `shell.toml` supplies the shared dimensions. `icon-size` sets the visual target, with a default of 12 logical pixels. `icon-canvas` sets the canvas, with a default of 16 logical pixels. `icon-slot` and `status-slot` set the button extent. These dimensions follow the font scale unless `scale-with-font` is false.
Custom `iconComponent` content also fits the shared target. Its source dimensions can be 15px or another size. The bar measures its glyph, image, or vector bounds and applies one scale without changing its aspect ratio. A source `iconSize` override does not change the rendered target. Image padding remains part of an application's tray asset.
`WidgetButton` also uses the shared renderer for a single icon glyph. This covers custom command widgets and existing plugins that use `WidgetButton` with a different `fontSize`. Text labels retain their text size. Custom widgets must use `WidgetButton` or `BarIconButton` for this icon contract.
## Custom user modules
The schema accepts arbitrary module ids that you provide. Set `type` to `command` for shell-driven output or `qml` for a custom QML widget. Both still go under `bar.layout.<section>` in `shell.json`.
@@ -58,7 +58,6 @@ BarWidget {
bar: root.bar
text: "\uf021"
slotSize: Style.bar.statusSlot
fontSize: Style.font.caption
tooltipText: "Pending Omarchy Updates"
onPressed: root.runUpdate()
}
+4 -3
View File
@@ -810,9 +810,10 @@ BarWidget {
}
TrayIcon {
anchors.centerIn: parent
width: Style.space(12)
height: Style.space(12)
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: Style.bar.iconSize
height: Style.bar.iconSize
icon: trayItemRoot.modelData.icon
}