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
Add parent when creating layer context menu to inherit application theme and add style entry for disabled widgets and menus #5381
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5381 +/- ##
==========================================
+ Coverage 89.09% 89.11% +0.01%
==========================================
Files 597 597
Lines 50614 50614
==========================================
+ Hits 45095 45103 +8
+ Misses 5519 5511 -8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I also never noticed... @psobolewskiPhD maybe you could block this with a negative review to avoid premature merging, since you have a mac and can check future changes! |
It looks like something was missing from qss, but it looks like macOS specific problem. |
Thanks for the feedback @psobolewskiPhD ! Will check on macOS to see what I can do 👍 |
Updated the screenshots testing on Windows, macOS and Ubuntu. The current approach sets a style that works as far as I tested on all three. Thinking on alternatives, another approach could be to only set the |
Further changes were done
Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Trying to update the OP preview for the application menu, seems like the suggested style rules for File menuView menuMaybe some application menus are created in a different way than using |
I think it may be related to the app-model menu roll out. Also my suggestion may have been a bit reckless, not sure that the menu code makes sense there? At the very least maybe a comment is worth adding—sorry I neglected this. |
Thanks for the explanation! Will check adding the extra comment/changing the position for the Again thanks for all the help, reviews and suggestion done here! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @dalthviz 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this :)
…eme and add style entry for disabled widgets and menus (napari#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…eme and add style entry for disabled widgets and menus (#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…eme and add style entry for disabled widgets and menus (#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…eme and add style entry for disabled widgets and menus (#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…eme and add style entry for disabled widgets and menus (#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…eme and add style entry for disabled widgets and menus (#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…eme and add style entry for disabled widgets and menus (#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…eme and add style entry for disabled widgets and menus (#5381) * Add parent when creating layer context menu to inherit application theme * Remove opacity for disabled widgets background color style * Set border-color for disabled widgets to background * Set selection-background-color to transparent for disabled widgets * Swap border-color and background-color for disabled widgets style * Apply suggestions from code review Style for menu separators and padding Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> * Move QModelMenu styles to 02_custom styles Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Description
Hi, this adds a missing parent kwarg so the layer context menu inherits the application theme (possible bug found while working on PR #5362). Also, add a style rule for disabled widgets (to for example show with a different style disabled entries on menus):
Preview
Layer context menu
Windows:
MacOS:
Ubuntu:
Application menus
Windows:
MacOS:
On macOS the application menus are integrated with the OS so the qss style doesn't change the way they look.
Ubuntu:
Type of change
References
How has this been tested?
as there are small differences between the two Qt bindings.
Final checklist: