Skip to content

fix(noctalia): inherit NIconButton so bar widgets pick up global styling#143

Merged
VictorGSchneider merged 1 commit into
mainfrom
claude/loving-ride-niconbutton
Jun 12, 2026
Merged

fix(noctalia): inherit NIconButton so bar widgets pick up global styling#143
VictorGSchneider merged 1 commit into
mainfrom
claude/loving-ride-niconbutton

Conversation

@VictorGSchneider

@VictorGSchneider VictorGSchneider commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the "bar Settings doesn't affect my widgets; they're stuck tiny" report. The previous BarWidgets were Item + Rectangle + NIcon + MouseArea built by hand — they ignored the global bar config (capsule color, outline, size, font scale, density) entirely. They stayed pinned to whatever I'd hard-coded.

Both stoa-health and stoa-drive-pill now inherit NIconButton — the same component the official Clipboard, Plugin Manager and Workspace widgets use — with the exact property bindings I read from noctalia-plugins/clipboard/BarWidget.qml:

Property Value
baseSize Style.getCapsuleHeightForScreen(screen?.name)
applyUiScale false
tooltipDirection BarService.getTooltipDirection(screen?.name)
customRadius Style.radiusL
colorBg Style.capsuleColor
colorFg dynamic state color (health severity / mount state)
colorBgHover Color.mHover
colorBorder "transparent"

Result: bar Settings tweaks (size, color, outline, density) now propagate into both widgets like they do for built-in ones.

Knock-on changes

  • Pulse animation gone: NIconButton runs its own opacity/hover transitions; pulsing the whole button looked off against the rest of the bar. Severity is still obvious from colorFg. The pulse toggle and manifest setting are removed.
  • Badge as overlay: the issue-count badge (health) and m/t badge (drive) move to a Rectangle anchored top-right with z: 2, instead of an inline RowLayout child — keeps them visible without messing up the button's intrinsic size.
  • stoa-health bumped to 1.2.0.

Test plan

  • Open bar Settings → change capsule color / outline / size / density → both widgets follow the changes
  • Inject a [FAIL] line into ~/.config/stoa/doctor.log → red icon + count badge top-right
  • Unmount one drive → amber icon + m/t badge top-right
  • Right-click both → Settings opens the plugin settings dialog
  • Hover both → tooltip text shows in the correct bar direction
  • No visual regression on left/right click panel toggling

https://claude.ai/code/session_01NS2BA7fzvSsp3ZhPzU18fL


Generated by Claude Code

The previous BarWidgets were Item + Rectangle + NIcon + MouseArea
assembled by hand, with hard-coded sizes — so changes in the Noctalia
bar Settings (capsule color, outline, size, font scale, density) had
no effect on them. They stayed pinned to whatever I'd picked.

Both stoa-health and stoa-drive-pill now inherit NIconButton (the same
component the official Clipboard, Plugin Manager and Workspace
widgets use), with:

  • baseSize        = Style.getCapsuleHeightForScreen(screen?.name)
  • applyUiScale    = false
  • tooltipDirection= BarService.getTooltipDirection(screen?.name)
  • customRadius    = Style.radiusL
  • colorBg         = Style.capsuleColor
  • colorFg         = the dynamic state color
  • colorBgHover    = Color.mHover
  • colorBorder     = "transparent"

That makes them respond to bar Settings exactly like the built-in
widgets — same capsule, same outline, same height per-screen, same
hover behaviour.

The health-status pulse animation is dropped: NIconButton manages its
own opacity/hover transitions, and pulsing the whole button looked off
against the rest of the bar. Severity is still obvious from colorFg.
The `pulse` setting and its toggle are removed (manifest + Settings).

The issue-count badge (stoa-health) and m/t badge (stoa-drive-pill)
move to a Rectangle overlay anchored to the top-right of the button,
z: 2, instead of an inline RowLayout child — keeps the badge visible
without breaking the button's intrinsic size.

stoa-health version 1.2.0.
@VictorGSchneider VictorGSchneider self-assigned this Jun 12, 2026
@VictorGSchneider VictorGSchneider merged commit e012d24 into main Jun 12, 2026
1 check passed
@VictorGSchneider VictorGSchneider deleted the claude/loving-ride-niconbutton branch June 12, 2026 02:22
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.

2 participants