Skip to content

Add vertical taskbar support with an upright layout#62

Open
syncrodazt wants to merge 2 commits into
CodeZeno:mainfrom
syncrodazt:vertical-taskbar-support
Open

Add vertical taskbar support with an upright layout#62
syncrodazt wants to merge 2 commits into
CodeZeno:mainfrom
syncrodazt:vertical-taskbar-support

Conversation

@syncrodazt

Copy link
Copy Markdown

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.

  • Orientation setting (Settings → Orientation): Automatic / Horizontal / Vertical.
    Automatic detects the taskbar's orientation from its shape, resolved per taskbar.
  • Native vertical layout — instead of rotating the horizontal strip, the vertical
    taskbar gets a purpose-built upright column: each usage window (5h, 7d) is a stacked
    block of label + % over bar + countdown, text kept horizontal. Width follows the taskbar.
  • Bar Length setting (Settings → Bar Length): Off / 3 / 5 / 10. Segments auto-fit the
    space left of the countdown so the bar never collides with it; Off shows the percentage only.
  • Dragging, resize cursor, and tray-anchored positioning are orientation-aware.
    The horizontal layout is unchanged.

Screenshots

Vertical layout on a StartAllBack taskbar:

image

Orientation setting:

image

Bar Length setting:

image

Implementation notes

  • Orientation (effective) and OrientationPref (user choice) enums; the preference
    resolves against the docked taskbar's rect.
  • Positioning unified in place_widget, reasoning in taskbar main/cross axes.
  • paint_content dispatches to paint_horizontal / paint_vertical; the segment loop
    is factored into draw_bar_segments and shared.
  • New settings persist in settings.json (orientation, vertical_bar_segments).
  • New menu strings localized across all 11 languages.

Testing

  • cargo build --release — clean (no warnings).
  • Verified on a StartAllBack vertical taskbar: Automatic detection, all three orientation
    modes, all Bar Length options, and dragging to reposition. Horizontal unchanged.

🤖 Generated with Claude Code

syncrodazt and others added 2 commits July 18, 2026 23:33
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant