Skip to content

enh(ui): ui::qt::parameters slider styling

Erwan DUHAMEL requested to merge 1243-enh-ui-ui-qt-parameters-slider-styling into dev

Description

qt::parameters was (forcefully) sensibly reworked. I initially just wanted to align the labels vertically on sliders, but this required a lot of changes in terms of QLayout that impacted the rest of the widget.

The reason is that I had to add to change the main layout (previously, QGridLayout), which didn't provide a way to correctly align both slider labels and widgets row by row. Some alignment property was inherited by each individual widgets, which looked OK for horizontal sliders, but looked as you can see on the issue for vertical ones. Plus, wasn't "truly" aligned any way (again, see the screeshots in the issue).

Any way:

  • Vertical sliders labels are now aligned.
  • Vertical sliders labels are also aligned.
  • Widgets can have a minimum size (in terms of width/height).

Breaking change(s)

This drastically changes the appearance of the widget in some context. I don't know which GUI tests rely on the old style, please mention them as comment, so I can update them.

ex_parameters in now in ircad_style.qss.

Results

🗒 See also the internal note below

For an overview in apps in other repositories.

IRCAD-styled ex_parameters

Just so you get an overview of the properly aligned widgets.

Screenshot_from_2024-03-11_17-53-53

Properly-aligned vertical sliders (both int and double).

image

How to test it?

PLEASE TEST ALL YOUR APPS. I CAN'T GUARANTEE NOTHING GOT BROKEN.

  • Launch ex_parameters
  • Launch sight_viewer

Closes #1243 (closed)

Edited by Erwan DUHAMEL

Merge request reports