Skip to content

Shell/UI: Expose PanelSlider corner radii as properties - #10915

Open
JaxonWright wants to merge 2 commits into
omacom:quattrofrom
JaxonWright:ui/panelslider-radius-properties
Open

Shell/UI: Expose PanelSlider corner radii as properties#10915
JaxonWright wants to merge 2 commits into
omacom:quattrofrom
JaxonWright:ui/panelslider-radius-properties

Conversation

@JaxonWright

@JaxonWright JaxonWright commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Ui/PanelSlider.qml hardcodes the corner radius of the three parts it draws: the track (height / 2), the tick marks (1), and the knob (knobSize / 2). Everything else about the component is already themeable through properties.

That leaves one option for a plugin that wants square controls. Copy the file. I hit this in a third-party WaveBar media widget, where the vendored copy now has to be diffed against this one on every release to catch changes, and that diff is three lines.

This lifts the three values into properties whose defaults are the expressions they replace:

property real trackRadius: trackHeight / 2
property real tickRadius: 1
property real knobRadius: knobSize / 2

The track Rectangle's height is root.trackHeight, so trackHeight / 2 is the value height / 2 already produced. The fill binds radius: track.radius, so it follows the track and needs no property of its own.

Existing callers set none of these. plugins/panels/audio/Panel.qml, plugins/panels/monitor/Panel.qml, and the dev gallery render exactly as before.

qmllint -I shell reports the same warnings as it does on the current file, plus one on radius: root.tickRadius. That is the unqualified-access class the surrounding lines in the same Repeater delegate already produce, color: root.tickColor among them.

🤖 Generated with Claude Code

The track, tick and knob radii were hardcoded, so a plugin that wants
square controls has to copy the whole component and re-sync it on every
release. Lift the three values into properties whose defaults are the
existing expressions, leaving every current caller unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X95T9KDihKJTi8BouLq4Lt
@JaxonWright JaxonWright changed the title Expose PanelSlider corner radii as properties Shell/UI: Expose PanelSlider corner radii as properties Sep 9, 2026
Covers both halves of the property change: the defaults still draw the
pill shape existing callers render, and setting the three properties to 0
squares every corner the component draws.

The runtime fixture walks the slider's children rather than reaching for
track, fill and knob by declaration order, so it keeps working if the
component gains a drawn part.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X95T9KDihKJTi8BouLq4Lt
@JaxonWright

JaxonWright commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Added test/shell.d/panel-slider-radius-test.sh, following the shape of button-border-stability-test.sh. It pairs a source assertion with a headless Quickshell fixture behind the usual require_compositor and quickshell guards.

It covers both halves of the change. The defaults still resolve to trackHeight / 2, 1 and knobSize / 2, and every corner the component draws stays rounded. Setting the three properties to 0 squares all of them, which is the case that previously required copying the file.

The fixture walks the slider's children collecting anything with a radius, rather than reaching for the track, fill and knob by declaration order, so it survives the component gaining a drawn part.

I checked it against the pre-change component, where it fails on Cannot assign to non-existent property "knobRadius". ./test/shell is otherwise unchanged. 4 of 237 files fail here, and the same 4 fail on an unmodified quattro checkout, because they want an omarchy-pkgs checkout that my machine doesn't have.

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