Skip to content

Minor changes in Qt styles handling

Andrei Kortunov requested to merge akortunov/openmw:style_change into master

Qt has a quirk - if a widget has a custom style sheet, it ignores system style changes. An easy way to reproduce this issue is to start OpenMW's launcher in Windows with the theme which supports a dark mode (-style fusion, for example) and then switch a dark mode state. As a result, a toolbar with tabs icons does not change its color:

image

There are at least three ways to avoid such issue:

  1. Do not use stylesheet where we can avoid them.
  2. Apply them again when application palette changes where we can not avoid them.
  3. Reset style sheet for the whole Qt application via setStyleSheet(""), but it is a "nuclear" option.

I use 1 and 2 in this MR. Summary of changes:

  1. Update toolbar style in launcher when application palette changes (as described above).
  2. Do not use style sheets to make installation method text bold in Wizard to avoid this issue:

image

  1. Remove border from status bar. It is inconnsistent anyway (for example, windowsvista style applies only right border, windows style - only right and bottom borders):

image

Without border it does not look any worse:

image

  1. Use an autoraise mode for clear button in the launcher to avoid style sheet, as we do for another icon-based buttons in the launcher. Autoraise mode does not render button's border and background when the button is not hovered or activated.
  2. Explicitely highlight an Open button in the editor when we enable it:

image

It already becomes active (you can press Enter to activate it), but some styles do not highlight it (e.g. windows style).

Merge request reports