Add vertical taskbar support with an upright layout#62
Open
syncrodazt wants to merge 2 commits into
Open
Conversation
The widget previously assumed a horizontal taskbar: it rendered a fixed ~200px strip and anchored it to the right of the tray. On a vertical taskbar (e.g. StartAllBack) it overflowed and was unusable. Add an Orientation preference (Automatic/Horizontal/Vertical) that the widget resolves against the taskbar it is docked to. Automatic detects a vertical taskbar from its aspect ratio, so no configuration is needed in the common case. For vertical taskbars the widget now uses a dedicated upright layout instead of rotating the horizontal one: each usage window is a stacked block of "label + %" over "bar + countdown", with text kept horizontal so it reads without tilting your head. Positioning, dragging, and the resize cursor are all orientation-aware; the widget width follows the taskbar. Add a Bar Length setting (Off / 3 / 5 / 10) for the vertical layout; the segment width auto-fits the space left of the countdown so the bar never collides with it. "Off" shows the percentage only. Rendering is split into paint_horizontal/paint_vertical behind a shared paint_content, and the segment-drawing loop is factored into draw_bar_segments so both layouts share it. All new menu strings are localized across the 11 supported languages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reserving a fixed width for the countdown assumed a two-character value
("3h", "4d"); a three-character one ("53m", "now") overflowed into the
bar. Measure the actual rendered width instead so the bar always stops
short of the countdown at any segment count.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for vertical taskbars (such as those created by StartAllBack).
Previously the widget only worked on a horizontal taskbar — on a vertical one
it overflowed and was unreadable.
Automatic detects the taskbar's orientation from its shape, resolved per taskbar.
taskbar gets a purpose-built upright column: each usage window (5h, 7d) is a stacked
block of
label + %overbar + countdown, text kept horizontal. Width follows the taskbar.space left of the countdown so the bar never collides with it; Off shows the percentage only.
The horizontal layout is unchanged.
Screenshots
Vertical layout on a StartAllBack taskbar:
Orientation setting:
Bar Length setting:
Implementation notes
Orientation(effective) andOrientationPref(user choice) enums; the preferenceresolves against the docked taskbar's rect.
place_widget, reasoning in taskbar main/cross axes.paint_contentdispatches topaint_horizontal/paint_vertical; the segment loopis factored into
draw_bar_segmentsand shared.settings.json(orientation,vertical_bar_segments).Testing
cargo build --release— clean (no warnings).modes, all Bar Length options, and dragging to reposition. Horizontal unchanged.
🤖 Generated with Claude Code