Skip to content

Add labelInTitle option to SliderSetting#503

Open
Suor wants to merge 1 commit into
MSUTeam:developmentfrom
Suor:feature/slider-label-in-title
Open

Add labelInTitle option to SliderSetting#503
Suor wants to merge 1 commit into
MSUTeam:developmentfrom
Suor:feature/slider-label-in-title

Conversation

@Suor

@Suor Suor commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Any labels longer then several symbols overlap with a control to the right (if slider is in the left column). This is fine for most cases, where labels is a number or a single short word, but lacks flexibility.

This PR adds an optional labelInTitle mode to SliderSetting. When enabled, the slider's current-value label is rendered in the setting's title row (right-aligned) instead of next to the slider track.

API

local setting = ::MSU.Class.SliderSetting(...);
setting.setLabelInTitle(true);

I tried passing it to constructor, it works but cumbersome without named params, which squirrel lacks and MSU doesn't emulate. Settled on accessor.

Changes

  • slider_setting.nut: new LabelInTitle field (default false), setLabelInTitle(_value) setter, and labelInTitle passed through getUIData().
  • slider_setting.js: when labelInTitle is set, detach the label and append it to the titleContainer.

Default behavior is unchanged (LabelInTitle = false).

Lets a slider render its current value label in the title row instead of
next to the slider track, via SliderSetting.setLabelInTitle(true).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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