Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(POC) add skin styles for Preferences & Track Properties, LateNight PaleMoon only #13842

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Nov 6, 2024

One of my infamous 'coffee break projects'
Reason is that I don't have / can't built Qt6ct to get a proper dark theme, yet, ie. I get the rather bright default Qt theme which is annoying when playing in dark places.
So I styled Track Properties and the preferences manually. PaleMoon only!

Still WIP but is already usable and a huge improvement for me.

Update:
After doing some live tests I decided to style ALL dialogs.
This required some not-so-nice fixes / hacks in c++, see (A). If someone has ideas for alternative solutions feel free to post them.

Disclaimer:

  1. For now, my intention is only to share the progress, not to get this into a mergable state, but I'll continue polishing it a bit.
  2. The c++ changes probably screw up Track Properties for skins/themes other than LateNight PaleMoon because the dialogs now have a parent (WTrackMenu) so they inherit styles, either from WTrackProperty or WTrackTableView. Maybe this can be avoided by using explicit (library) object selectors in the stylesheets.
  3. In order to style QGroupBoxes in the preferences I had to remove to the workaround for supporting legacy skins (< Mixxx 1.12) from LegacySkinparser. Ie. in stylesheets that use the QGroupBox selector that will not anymore be transformed to WWidgetGroup. I could add a warning so this change can be noticed by users but this has no prio at all.

(screenshots are a bit outdated but you get the idea..)
Screenshot_2024-11-06_18-16-00
Screenshot_2024-11-06_18-21-15

(A) The most important "fix" is to use the main "Skin" widget as parent for all dialogs created by non-GUI classes, accomplished with a widgethelper function that finds the centralWifget() "Skin" amongst the QApplication::topLevelWindgets().
While it works it introduces the tiny risk that the Skin widget is being destroyed / recreated while a dialog is open. This is rather unlikely (who would reload a skin while something like Track Export is active?) and would only kill such dialogs.
Alternative (neither evaluated nor tested):
use the mainwindow as parent, catch 'ChildAdded' events, add the centralWidget()'s stylesheet to new children.

@ronso0 ronso0 changed the title WIP add skin styles for Preferences & Track Properties, LateNight PaleMoon only (POC) add skin styles for Preferences & Track Properties, LateNight PaleMoon only Nov 7, 2024
@ronso0 ronso0 force-pushed the track-info-pref-styles branch 2 times, most recently from 129b65a to 68bf3cd Compare November 7, 2024 19:35
@ronso0
Copy link
Member Author

ronso0 commented Nov 9, 2024

After doing some live tests I decided to style ALL dialogs.
This required some not-so-nice fixes / hacks in c++ and makes skin load take a little longer but everything looks good now.

@Eve00000
Copy link
Contributor

After doing some live tests I decided to style ALL dialogs. This required some not-so-nice fixes / hacks in c++ and makes skin load take a little longer but everything looks good now.

Is it an option to get a day/night switch in the preferences in the future?

@ronso0
Copy link
Member Author

ronso0 commented Nov 11, 2024

A daylight color scheme would do the trick.

@github-actions github-actions bot added the broadcast Bugs pertaining to streaming radio broadcaster use-case label Nov 17, 2024
@ronso0 ronso0 force-pushed the track-info-pref-styles branch 2 times, most recently from 02d4329 to 171a170 Compare November 19, 2024 15:25
@ronso0
Copy link
Member Author

ronso0 commented Nov 19, 2024

Alright, I'm now happy with this.

Looks like it's easy to keep the preferences theme intact for skins/color themes other than LateNigh PaleMoon, will finish this.

Also, I was wrong about the slowdown: skin re/load is as fast as before (besides those extra ~200 ms for styling the preferences, of course).

@ronso0
Copy link
Member Author

ronso0 commented Nov 19, 2024

Let me know if there's interest in polishing this for getting it in main.
Otherwise I'll close this PR and move it to my repo to not spam the Mixxx repo/notifications anymore with updates.

@Eve00000
Copy link
Contributor

Eve00000 commented Nov 19, 2024

Let me know if there's interest ...in getting it in main.

YES!

…teNight PaleMoon only

* use skin stylesheet for preferences
* use skin stylesheet for all dialogs spawned by non-GUI classes by using MixxxMainWindow's
  centralWidget() (#Skin) as parent, via mixxx::widgetHelper
@ronso0
Copy link
Member Author

ronso0 commented Nov 21, 2024

Let me know if there's interest ...in getting it in main.

YES!

Yeah I'm sure there are users who appreciate this, though my question was rather whether core devs a) see a necessity for this and b) are okay with the c++ hacks. (and I myself am not 100% convinced that this is appropriate for the official version)

@daschuer
Copy link
Member

a)
I am personally fine with the current state because the style aligns with the rest of the OS. But I am not opposing against this.
The downside might be a bit more hassle later if we need to consider all skins when altering something in the preferences.
But if you like to do the effort, go ahead.

b)
It does not look too scary ..

Is there much work left?

If you ask me what else is important regarding skins:

@ronso0
Copy link
Member Author

ronso0 commented Nov 22, 2024

Thanks for your feedback!

I'm aware of the other helpful tweaks (just commented in #13854, not possible in the QWidget skins, and I might take a stab at the (LateNight) daylight theme during winter).

It does not look too scary ..

Great!

Is there much work left?

Yes. Keeping the other skins/themes intact is a hazzle because of how style sheets are inherited. In particular QTooltips and WColorPicker's bg & button style in Track Properties.
I might be able to fix it with dedicated object names.

The downside might be a bit more hassle later if we need to consider all skins when altering something in the preferences.
But if you like to do the effort, go ahead.

I don't expect trouble with that because, except for some QLines in the preferences, the preferences style selectors are general, ie. addressing the QWidgets by type not by name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants