Skip to content

Make Slider UI elements larger when widget size increases#3854

Open
georgweiss wants to merge 2 commits into
masterfrom
CSSTUDIO-1723
Open

Make Slider UI elements larger when widget size increases#3854
georgweiss wants to merge 2 commits into
masterfrom
CSSTUDIO-1723

Conversation

@georgweiss

Copy link
Copy Markdown
Collaborator

The Scaled Slider widget relies on the native JavaFX Slider. On high resolution monitors the default size of the track and knob may become a bit too small. While increasing the font is supported in the widget, other UI elements stay at their defaults even if widget is made taller/wider.

This PR adds a bit of logic to increase the width of the track, the size of the knob and the length of the major tick marks when user increases the height (horizontal) or width (vertical) of the widget. Unfortunately I was not able to figure out how to also make minor tick marks longer.

A minimum and maximum is applied to keep this reasonably useful:

Screenshot 2026-06-26 at 15 41 47 Screenshot 2026-06-26 at 15 42 02 Screenshot 2026-06-26 at 15 42 11

Decided that new widget properties for track, knob and major tick mark dimensions would be an overkill.

  • Testing:

    • The feature has automated tests
    • Tests were run
    • If not, explain how you tested your changes
  • Documentation:

    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

@georgweiss georgweiss requested review from kasemir and shroffk June 26, 2026 13:44

@kasemir kasemir left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sad to see how carefully aligned code, typed by a human with pride in his/her work like this:

Image

... is replaced by mechanical formatting like this:

Image

After all, this PR is all about cosmetics, the size of a slider button, so style does seem to matter at some level.

Still, I like the end result, so whatever

@georgweiss

Copy link
Copy Markdown
Collaborator Author

@kasemir, sorry for hurting your pride. I will revert.

@sonarqubecloud

Copy link
Copy Markdown

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