Skip to content

Add a barHeight setting to cap bar travel - #1

Open
epicbagel wants to merge 1 commit into
twodogsdave:mainfrom
epicbagel:add-bar-height
Open

Add a barHeight setting to cap bar travel#1
epicbagel wants to merge 1 commit into
twodogsdave:mainfrom
epicbagel:add-bar-height

Conversation

@epicbagel

Copy link
Copy Markdown

Problem

track is pinned to the widget's full height minus 8px, with no way to tune it:

readonly property int track: Math.max(4, (vertical ? width : height) - 8)

Bars grow upward from the bottom of that track. On a bar taller than the 26px
default, that sinks the visualizer's mass to the bottom edge while every
neighbouring icon stays vertically centred, so Cava reads as misaligned with the
rest of the bar.

I hit this on a 70px bar (a 5K display at scale 1.6, plus a floating bar inset).

Measurements

Measured from screenshots by scanning pixel columns, same audio source, bar slab
centre at y=54:

barHeight: 0 (today) barHeight: 20
Baseline y=79 y=69
Visible mass centre y=66.5 y=56.5
Offset from bar centre 12.5px low 2.5px

Change

Adds a barHeight setting that caps how far a bar can travel:

readonly property int track: {
  var available = Math.max(4, (vertical ? width : height) - 8)
  return barHeight > 0 ? Math.min(barHeight, available) : available
}
  • Defaults to 0, which keeps the current fill-the-bar behaviour exactly. No
    existing config changes appearance.
  • Clamped with Math.min(barHeight, available), so it can never overflow the bar.
  • Also clamped to 0..128 via the existing clampInt helper.
  • Exposed in the popup menu next to Bar width, and declared in the manifest
    defaults and schema so it shows up in plugin settings UI.
  • README settings table and a short note on why you'd reach for it.

Applies to vertical bars too, where it caps bar length rather than height.

Testing

  • omarchy plugin validate passes.
  • Verified live with audio playing: baseline moved to the predicted position
    (centre + track/2 = 70, measured 69), and bar length stayed within the new
    budget.
  • Confirmed barHeight: 0 renders identically to before the change.

One note for anyone testing: the widget kept the old track after
omarchy-shell shell rescanPlugins; it only picked up the QML change after
omarchy restart shell.

The drawing track was pinned to the widget's full height minus 8px, with
no way to tune it. Bars grow upward from the bottom of that track, so on a
bar taller than the 26px default the visualiser's mass sits along the
bottom edge while every neighbouring icon stays vertically centred.

Measured on a 70px bar: the baseline landed at y=79 and the visible mass
centred at y=66.5, against a bar centre of y=54 — 12.5px low. With
barHeight at 20 the baseline moves to y=69 and the mass to y=56.5, 2.5px
off centre.

barHeight defaults to 0, which keeps the previous fill-the-bar behaviour,
and is clamped to the space actually available so it can never overflow
the bar. Exposed in the popup menu alongside bar width, and declared in
the manifest schema and defaults.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SRunvW8r5Qhi359HNzCdJa
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