Shell/UI: Expose PanelSlider corner radii as properties - #10915
Shell/UI: Expose PanelSlider corner radii as properties#10915JaxonWright wants to merge 2 commits into
Conversation
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
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
|
Added It covers both halves of the change. The defaults still resolve to The fixture walks the slider's children collecting anything with a I checked it against the pre-change component, where it fails on |
Ui/PanelSlider.qmlhardcodes 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:
The track Rectangle's height is
root.trackHeight, sotrackHeight / 2is the valueheight / 2already produced. The fill bindsradius: 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 shellreports the same warnings as it does on the current file, plus one onradius: root.tickRadius. That is the unqualified-access class the surrounding lines in the same Repeater delegate already produce,color: root.tickColoramong them.🤖 Generated with Claude Code