Skip to content

Fix segment count to 7 for weekly (and optionally session) usage bar - #71

Open
Lexx-Agency-dev wants to merge 2 commits into
CodeZeno:mainfrom
Lexx-Agency-dev:fix/segment-count-7d
Open

Fix segment count to 7 for weekly (and optionally session) usage bar#71
Lexx-Agency-dev wants to merge 2 commits into
CodeZeno:mainfrom
Lexx-Agency-dev:fix/segment-count-7d

Conversation

@Lexx-Agency-dev

Copy link
Copy Markdown

Problem

Both the 5h and 7d usage bars currently render with the same fixed
segment count (SEGMENT_COUNT = 10 in src/window.rs, used via
row_bar_segment_count when only one model is active). For the 7-day
window this doesn't map onto 7 days, making the bar less intuitive to
read at a glance.

Change

Changed SEGMENT_COUNT from 10 to 7, so each segment in the bar
corresponds to one day for the 7d window (and, since both rows share
this constant, also gives the 5h bar 7 segments for visual consistency).

- const SEGMENT_COUNT: i32 = 10;
+ const SEGMENT_COUNT: i32 = 7;

Scope / impact

  • Only affects the active_models == 1 case (single model shown).
    The 2-model (5 segments) and 3-model (4 segments) layouts in
    row_bar_segment_count are unchanged.
  • No layout/width bugs: bar width, text position and widget width are
    all computed from segment_count, so they scale automatically.
  • No new dependencies, no unrelated files touched.

Testing

Built locally with cargo build --release and confirmed the taskbar
widget renders both bars with 7 segments, filling proportionally to
the reported usage percentage.

Screenshots

Before: [10 segments]
After: [7 segments]

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