theme: uniform chip height, fix hamburger radius cascade, spotlight dot spec, first-paint trail bug
Decision #1 (one chip highlight height per bar, vertically centred): the .stat-pair/.stat-pair.icon-only/.media-widget/workspace-btn CSS all sized to their own content box before this (min-height: 0, or a stale 32/20px figure), which is why battery sat high and wifi/menu ran taller than their neighbours. Added a hardcoded approved_chip_height() (26/22/22 by WorkspaceStyle, matching the demo spec) since bread-ecosystem's own chip_height token (32/20/36) predates this pass and disagrees with it, and that repo is a sibling agent's this cycle. Also found and fixed a second copy of the hamburger-corner-mismatch bug: .control-panel-btn (hamburger only) hardcoded its own border-radius/ min-width/min-height *later* in the cascade than .stat-pair, silently winning over chip_radius/chip_height regardless of the icon-only fix already in place. Dropped the four conflicting properties so .stat-pair cascades through unchanged. Spotlight workspace dots: bumped to the approved Option B spec (10px tall, widths 8/13/17/22 by open-window count) — the prior pass landed 9px/[6,10,14,18], one generation behind. dot_widths is likewise theme.toml-derived and stale, so overridden locally with a comment rather than edited upstream. Workspace row "sits low on first paint" bug: root cause was the ws-in entrance animation (row-in keyframe, margin-top 8px -> 0) playing on every button during the very first rebuild_buttons call, racing WorkspaceTrail::place()'s single-shot geometry sample and freezing the trail pill a few px low until the next real switch re-measured settled layout. The demo never animates the initial row in at all — only subsequently-added workspaces should. Suppressed ws-in specifically on the first build (button_map starts empty exactly once). Also fixed: make_button's set_size_request was still pinning the stale tokens().chip_height() as a hard GTK minimum, which would have out-ranked the CSS min-height fix above for Trail/Pill workspace pills.
This commit is contained in:
parent
dd5618a5ea
commit
70fe814593
3 changed files with 123 additions and 27 deletions
22
src/main.rs
22
src/main.rs
|
|
@ -1995,6 +1995,13 @@ impl App {
|
|||
self.workspace_trail.cancel();
|
||||
let prev: std::collections::HashSet<WorkspaceId> =
|
||||
self.button_map.keys().copied().collect();
|
||||
// `button_map` only starts empty once — the very first call this
|
||||
// App instance ever makes, before any workspace has ever been
|
||||
// synced from Hyprland. A fully-emptied bar never happens after
|
||||
// that (the active workspace's own row is always kept), so this
|
||||
// doubles as a clean "is this the initial paint" signal without a
|
||||
// dedicated flag — see its one use below.
|
||||
let is_first_build = prev.is_empty();
|
||||
while let Some(child) = self.workspace_box.first_child() {
|
||||
self.workspace_box.remove(&child);
|
||||
}
|
||||
|
|
@ -2038,7 +2045,20 @@ impl App {
|
|||
bar::workspaces::make_button(ws.id, &ws.name, self.active_ws, ws.windows > 0)
|
||||
}
|
||||
};
|
||||
if !prev.contains(&ws.id) {
|
||||
// Never on the very first build (bug: "the [Trail] row sits
|
||||
// ~5px low on first paint and only corrects after the first
|
||||
// switch"). Root cause: `ws-in`'s `row-in` keyframe animates
|
||||
// `margin-top` 8px → 0 over 320ms; `WorkspaceTrail::place`
|
||||
// (called once, synchronously-ish, right after this loop for
|
||||
// the initial row) samples each button's geometry via a
|
||||
// single-shot tick callback that can fire while that margin
|
||||
// is still mid-animation, freezing the trail pill a few px
|
||||
// low until the next `place`/`stretch` call (the first real
|
||||
// workspace switch) re-samples the by-then-settled layout.
|
||||
// The demo itself never animates the initial row in at all
|
||||
// (`OCC.forEach` builds plainly, only `place(0)` runs) — only
|
||||
// *subsequently added* workspaces should ever play this.
|
||||
if !is_first_build && !prev.contains(&ws.id) {
|
||||
play_once(&btn, "ws-in", 360);
|
||||
}
|
||||
self.workspace_box.append(&btn);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue