Skip to content

Preferences: choose dark or light icons depending on OS theme#3484

Merged
Holzhaus merged 6 commits into
mixxxdj:2.3from
ronso0:pref-icon-color
Jan 11, 2021
Merged

Preferences: choose dark or light icons depending on OS theme#3484
Holzhaus merged 6 commits into
mixxxdj:2.3from
ronso0:pref-icon-color

Conversation

@ronso0
Copy link
Copy Markdown
Member

@ronso0 ronso0 commented Dec 27, 2020

... because previously dark icons were hard to recognise with dark themes.

This is a rather simple approach that checks whether the palette's primary text color is dim or not and chooses the respective icon set. The two sets of dark and light icons include all icons in the side bar and those in the controller preset drop-down menu.
I removed the gradients and use plain color fill colors now. Icon folders are much smaller now because of 'optimized SVGs'.

To allow adding the icon set switch I refactored DlgPreferences to add the individual Pref page widgets and tree icons in a much more compact way in addPageWidget() insetad of separate slots.

image

@github-actions github-actions Bot added the ui label Dec 27, 2020
@ronso0 ronso0 added this to the 2.3.0 milestone Dec 27, 2020
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Dec 27, 2020

In conjunction with #3464 the preferences should now be usable with all sorts of themes.

Menubar theming per skin is on its way... :)

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Dec 27, 2020

@Holzhaus Can you check how that looks like with i3wm?

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Dec 27, 2020

@Be-ing Did you try this? Any comments on the code?

@ronso0 ronso0 force-pushed the pref-icon-color branch 2 times, most recently from aabef00 to 0355444 Compare December 27, 2020 21:46
@github-actions github-actions Bot added the build label Dec 27, 2020
@ronso0 ronso0 removed the build label Dec 27, 2020
@Holzhaus
Copy link
Copy Markdown
Member

@Holzhaus Can you check how that looks like with i3wm?

Sorry, I switched to pop-shell recently.

Copy link
Copy Markdown
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

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

Thanks. Works fine on pop-shell/GNOME.

Looks like some unrelated mass reformattings slipped in. Please either remove them or fix the missing p prefix for all pointer types.

Comment thread src/controllers/dlgprefcontroller.cpp Outdated
Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment thread src/preferences/dialog/dlgpreferences.cpp Outdated
// does not include the offset, so it is moved from the last position it had.
#else /* __WINDOWS__ */
// On linux, when the window is opened for the first time by the window manager,
// QT does not have information about the frame size so the offset is zero.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// QT does not have information about the frame size so the offset is zero.
// Qt does not have information about the frame size so the offset is zero.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ping

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Dec 29, 2020

Thanks. Works fine on pop-shell/GNOME.

Looks like some unrelated mass reformattings slipped in. Please either remove them or fix the missing p prefix for all pointer types.

okay, I'll fix that after adding the QDir suggestion.
I'm more interested in if fd89d47 is okay, then I'll fix the remaining issues in the other commits.

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Dec 29, 2020

I fixed the pointer prefixes and added the QDir suggestion.
Rebased onto fd89d47

Comment thread src/controllers/dlgprefcontroller.cpp Outdated
Comment thread src/preferences/dialog/dlgpreferences.cpp Outdated
@ronso0 ronso0 removed the build label Dec 31, 2020
@github-actions github-actions Bot added the build label Jan 1, 2021
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 2, 2021

QDir issues fixed, ready again.

Copy link
Copy Markdown
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

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

Just some minor comments.

There are also many opportunities for wrapping string literals into QStringLiteral(). Qt legacy burden, unfortunately.

Comment thread src/controllers/dlgprefcontroller.cpp Outdated
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 3, 2021

There are also many opportunities for wrapping string literals into QStringLiteral()

@uklotzde If you refer to the preset getter functions I could change that, but I'd rather do that in #3464

@uklotzde
Copy link
Copy Markdown
Contributor

uklotzde commented Jan 6, 2021

This is a already huge PR. No need for more refactoring here. I agree to defer those non-mandatory changes until later.

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 6, 2021

so all LGTY?

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 6, 2021

will fix the conflicts now

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 6, 2021

will fix the conflicts now

Done, CI all green

@ronso0 ronso0 removed the build label Jan 6, 2021
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 6, 2021

oha! I tried merging 2.3 into main locally and that is fun already right now. Some not so trivial conflicts in dlgpreferences.cpp
@uklotzde I guess you have a git rerere set for this.

After this PR merged some addPageWidget() optimizations will clash..
I volunteer for merging 2.3 > main then, looks feasible.

@ronso0 ronso0 marked this pull request as draft January 6, 2021 09:53
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 6, 2021

reset to Draft. there's one !fixup commit I missed to squash. I'll do this when you consider this ready to be merged.

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 7, 2021

reset to Draft. there's one !fixup commit I missed to squash. I'll do this when you consider this ready to be merged.

ping @uklotzde If this is fine now please let me know.
I'd then squash in fixup! 5f88ac2 and take care of merging 2.3 into main.

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 10, 2021

reset to Draft. there's one !fixup commit I missed to squash. I'll do this when you consider this ready to be merged.

ping @uklotzde If this is fine now please let me know.
I'd then squash in fixup! 5f88ac2 and take care of merging 2.3 into main.

@Holzhaus Final LGTM?
I'd like to take care of this and fix the main regression asap. Won't have too much time soon.

@Holzhaus
Copy link
Copy Markdown
Member

I didn't review this again because it's still marked as draft. Should I review?

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 10, 2021

Yes please.
I marked it as draft to prevent merging before I squashed !fixup! 5f88ac2

Per commit this is easy to review, starting with what you already reviewed.

@Holzhaus
Copy link
Copy Markdown
Member

Warning [Main]: Cannot open file ':/images/preferences/light/broadcast.svg', because: No such file or directory
Warning [Main]: Cannot open file ':/images/preferences/light/broadcast.svg', because: No such file or directory

Copy link
Copy Markdown
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

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

Code look good, thank you. When the missing icon error on start is fixed, we can merge IMHO.

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 10, 2021

Warning [Main]: Cannot open file ':/images/preferences/light/broadcast.svg', because: No such

fixed.

@github-actions github-actions Bot added the build label Jan 10, 2021
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 10, 2021

Code look good, thank you. When the missing icon error on start is fixed, we can merge IMHO.

Great, thanks for being quick!

Seems like a created a small mess with those forgotten !fixup commits and merging 2.3 later on.
I'll re-apply my commits without 2.3 now so this is in a good shape finally.
Edit ...with 2.3 merged on top to allow building without keyfinder issues

dark foreground text color > dark icons, light text > light icons
  # Conflicts:
  #	res/mixxx.qrc
  #	src/preferences/dialog/dlgpreferencepage.h
  #	src/preferences/dialog/dlgpreferences.cpp
@ronso0 ronso0 marked this pull request as ready for review January 10, 2021 23:16
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 10, 2021

Puuh, done.
If CI is all green please merge and I'll take care of 2.3 > main

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 10, 2021

@Holzhaus
CI is happy

@Holzhaus Holzhaus merged commit 863c8a8 into mixxxdj:2.3 Jan 11, 2021
@ronso0 ronso0 deleted the pref-icon-color branch January 11, 2021 18:04
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jan 11, 2021

Thanks. merging 2.3 to main now...huu fun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants