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

2249: Create a global stylesheet and allow user-built themes #2258

Open
wants to merge 72 commits into
base: main
Choose a base branch
from

Conversation

krzywon
Copy link
Contributor

@krzywon krzywon commented Oct 24, 2022

This PR is creates a centralized style sheet for all GUI widgets, has the start of two other themes that are currently disabled (Dark and Large Font), and allows for user-created themes.

Current functionality:

  • Sets a single style sheet for all GUI elements and alternates to modify background colors, fonts, etc.
  • Built-in style sheets are not (easily) accessible by the user
  • Replaced all setStyleSheet, setFont instances with a standardized GuiUtil method
  • Added the option for users to add their own themes
  • Added a preference to select a theme from the available options

Future features:

  • Document the system
  • User documentation for creating themes
  • Finish dark and large-font themes (and any others?)

@krzywon krzywon mentioned this pull request Oct 24, 2022
Copy link
Contributor

@lucas-wilkins lucas-wilkins left a comment

Choose a reason for hiding this comment

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

I think there needs to be a bit of thought about how this will work if we want, say, the ability to change the font size as a user-friendly setting.

src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
Copy link
Contributor

@pkienzle pkienzle left a comment

Choose a reason for hiding this comment

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

I don't think you want a user-controlled style sheet. I expect that old .css files will be a support headache down the line.

Instead I suggest putting the default style sheet as a resource much like an image file. We can document its location so that interested users can override it, but their changes will be gone with the next install.

src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
src/sas/system/style.py Outdated Show resolved Hide resolved
@lucas-wilkins lucas-wilkins added the Coal Star Award for 500+ Commits Behind 'main' This PR runs on a fossil version of main label Jan 30, 2023
@krzywon krzywon removed the Coal Star Award for 500+ Commits Behind 'main' This PR runs on a fossil version of main label Feb 7, 2023
@krzywon
Copy link
Contributor Author

krzywon commented Oct 30, 2023

There are now 4 themes. This should be ready for a full review.

@lucas-wilkins
Copy link
Contributor

Anything I need to do for the corfunc bit?

@krzywon
Copy link
Contributor Author

krzywon commented Oct 31, 2023

Anything I need to do for the corfunc bit?

Maybe have a check to see if I missed any inline styles, but I was able to pull many of them out.

@lucas-wilkins
Copy link
Contributor

Much better, still need to do something about the window borders, they appear to take the system theme.

@lucas-wilkins
Copy link
Contributor

Dark theme disabled and unchecked boxes are pretty much indistinguishable on my screen.

@lucas-wilkins
Copy link
Contributor

Other minor points: the check/radio boxes should not be white, and the blue non-focus color is very blue. The white font is too white too.

@butlerpd
Copy link
Member

Actually could be part of 6.0 .. but maybe a lower priority? Should take a look at

@rozyczko
Copy link
Member

hmmm these look like a downgrade from the existing style.
The default stylesheet looks pretty bad now.
Checkboxes look less intuitive.
Font clarity is much worse.

NEW:
sasview_sheets

OLD:
sasview_sheets_old

NEW:
sasview_sheets2

OLD:
sasview_sheets2_old

@lucas-wilkins
Copy link
Contributor

Pyside6 now natively supports dark and light themes, inherited from the OS.

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

Successfully merging this pull request may close these issues.

5 participants