From 9d0fe55bc6a0abb852278a1e5111d9ceba918e6e Mon Sep 17 00:00:00 2001 From: Nathan Nutter Date: Thu, 17 Sep 2026 19:18:53 -0500 Subject: [PATCH] Add Zed/Herdr icons --- Panel.qml | 10 +++--- README.md | 7 +++-- SvgActionButton.qml | 74 +++++++++++++++++++++++++++++++++++++++++++++ herdr.svg | 6 ++++ mise.toml | 4 +-- zed.svg | 3 ++ 6 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 SvgActionButton.qml create mode 100644 herdr.svg create mode 100644 zed.svg diff --git a/Panel.qml b/Panel.qml index 3da6400..9e5e331 100644 --- a/Panel.qml +++ b/Panel.qml @@ -694,10 +694,8 @@ Panel { anchors.verticalCenter: parent.verticalCenter spacing: Style.space(4) - PanelActionButton { - // Single-letter marks stand in for the Zed/Herdr logos - // so the buttons render in any panel font. - iconText: "Z" + SvgActionButton { + iconSource: "zed.svg" tooltipText: row.kind === "open" ? "Open in Zed" : "Create and open in Zed" foreground: root.foreground fontFamily: root.fontFamily @@ -705,8 +703,8 @@ Panel { onClicked: root.openInZed(row.index) } - PanelActionButton { - iconText: "H" + SvgActionButton { + iconSource: "herdr.svg" tooltipText: row.kind === "open" ? "Open in Herdr" : "Create in Herdr" foreground: root.foreground fontFamily: root.fontFamily diff --git a/README.md b/README.md index 7f8de40..7208a89 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Omarchy overlay plugin that fronts [`timber`](https://github.com/nnutter/timber) managed Git worktrees, mirroring `timber tui`: fuzzy-filter the existing worktrees, type `name@repo` to create, `enter` to open in Zed, or use -the trailing row icons to open in Zed (`Z`) or a Herdr space (`H`). +the trailing Zed/Herdr logo icons to open in Zed or a Herdr space. ## Requirements @@ -40,8 +40,9 @@ Keys: the header is a quickfilter field — type to filter `enter` open or create in Zed, `esc` clear then close. `tab` keeps the platform meaning of switching to the next panel. Creating runs `timber create --no-herdr name@repo` and opens the reported path in -Zed. Each selected row also offers trailing icons: `Z` opens in Zed -(same as `enter`), while `H` routes to Herdr — on a `name@repo` row +Zed. Each selected row also offers trailing logo icons: the Zed icon +opens in Zed (same as `enter`), while the Herdr icon routes to Herdr — +on a `name@repo` row it runs `timber create --herdr name@repo`, on an existing worktree it runs `timber herdr space --new name@repo` — the panel dismisses and a `Timber Herdr space created` notification confirms instead of opening diff --git a/SvgActionButton.qml b/SvgActionButton.qml new file mode 100644 index 0000000..5255895 --- /dev/null +++ b/SvgActionButton.qml @@ -0,0 +1,74 @@ +import QtQuick +import qs.Commons +import qs.Ui + +// Image-based sibling of PanelActionButton for the bundled Zed/Herdr +// SVG logos, which have no Nerd Font glyphs. Same box, hover fill, +// tooltip, and enabled gating as PanelActionButton; the image itself +// is rendered as-is (sourceSize keeps the raster crisp on hidpi). +BorderSurface { + id: root + + property string iconSource: "" + property string tooltipText: "" + property color foreground: Color.foreground + property color hoverColor: foreground + property string fontFamily: Style.font.family + property real size: Style.space(22) + + property bool focusable: false + + signal clicked() + + activeFocusOnTab: focusable + Keys.onReturnPressed: if (focusable) root.clicked() + Keys.onEnterPressed: if (focusable) root.clicked() + Keys.onSpacePressed: if (focusable) root.clicked() + + implicitWidth: size + implicitHeight: size + radius: Style.cornerRadius + + readonly property bool _showFocusRing: focusable && activeFocus + readonly property bool _hot: mouse.containsMouse && root.enabled + + color: _showFocusRing + ? Style.focusFillFor(hoverColor, hoverColor) + : (_hot + ? Style.hoverFillFor(hoverColor, hoverColor) + : "transparent") + borderSpec: _showFocusRing ? Border.controlSpec("focus", hoverColor, hoverColor) : Border.none() + + Behavior on color { ColorAnimation { duration: 60 } } + + Image { + anchors.centerIn: parent + source: root.iconSource + width: root.size - Style.space(8) + height: root.size - Style.space(8) + fillMode: Image.PreserveAspectFit + smooth: true + mipmap: true + sourceSize.width: 88 + sourceSize.height: 88 + opacity: root.enabled ? 1.0 : 0.4 + } + + MouseArea { + id: mouse + anchors.fill: parent + hoverEnabled: true + cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor + enabled: root.enabled + onClicked: { + if (root.focusable) root.forceActiveFocus() + root.clicked() + } + } + + PanelToolTip { + visible: root.tooltipText !== "" && mouse.containsMouse + text: root.tooltipText + fontFamily: root.fontFamily + } +} diff --git a/herdr.svg b/herdr.svg new file mode 100644 index 0000000..2305731 --- /dev/null +++ b/herdr.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/mise.toml b/mise.toml index a5779a4..86314e5 100644 --- a/mise.toml +++ b/mise.toml @@ -7,7 +7,7 @@ node = "24" [tasks.check] description = "Syntax-check the plugin JavaScript and lint the QML" -run = "node --check TimberModel.js && node --check tests/model.test.mjs && bash tests/qml_lint.sh Panel.qml" +run = "node --check TimberModel.js && node --check tests/model.test.mjs && bash tests/qml_lint.sh Panel.qml && bash tests/qml_lint.sh SvgActionButton.qml" [tasks.test] description = "Run TimberModel unit tests" @@ -23,7 +23,7 @@ set -euo pipefail id="io.github.nnutter.omarchy-timber" dest="${HOME}/.config/omarchy/plugins/${id}" mkdir -p "$dest" -cp manifest.json Panel.qml TimberModel.js "$dest/" +cp manifest.json Panel.qml SvgActionButton.qml TimberModel.js herdr.svg zed.svg "$dest/" if command -v omarchy-shell >/dev/null 2>&1; then omarchy-shell shell rescanPlugins || echo "rescan failed: is omarchy-shell running?" >&2 omarchy restart shell diff --git a/zed.svg b/zed.svg new file mode 100644 index 0000000..06b5c18 --- /dev/null +++ b/zed.svg @@ -0,0 +1,3 @@ + + +