-
-
Notifications
You must be signed in to change notification settings - Fork 187
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 App Preferences for Dark Mode and Locale Override #2756
Conversation
@amolenaar I could use some architecture advice, should Settings be a separate service? It started out as something that loaded with the help module, but now we need to check the setting while loading i18n to see if we have Use English set. |
That is a very good question 😄. Let's see:
Maybe start with a module that takes a global config from a It would for sure be nice to have it as an (application) service, but then the i18n code needs to be reworked too. UI-wise I would drop the sub-text ("Change the color scheme..."), and instead make the text "Override Dark Mode" more descriptive. |
@amolenaar Thanks! I made the changes to UI to remove the subtitles and try to make the descriptions more clear: I created a new settings module. Gio.Settings takes care of saving and loading settings based on the schema, so I think creating a separate config file may not be needed. Do you think sharing the Settings class instance with i18n and help is OK? |
I think there's not really any other way :). This does not have any impact for cases where we use Gaphor as a library, right? Like our documentation generation. |
Should I look at putting an exception in for our pytest-archon rules? |
The reason we are on an older GTK/libadwaita version is mainly due to our build server (Ubuntu), which is stuck on an older version. We have #2320 waiting to be merged for the same reason. I suggest we make the build work with the latest GTK/libadwaita version
What do you think? |
Hi @amolenaar, ya, I like your idea to either find a PPA with updated versions of GTK or use a container image. Let me start to investigate this! |
Linux is working great now. Neither Windows or macOS have libadwaita 1.4 yet due to AppStream compatibility. I'll work on some yak shaving to see if I can't get that going. |
8e33cd8
to
29db2ec
Compare
I noticed that we are getting a Cairo error in Windows from the last Gvsbuild update, let's hold off merging this until I investigate |
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.
Looks good. I think there are a few minor improvements to be made.
It may be worth to see if the settings module code can be moved into the UI module - so that settings made in the (ui) application are not applied when using (for example) a jupyter notebook.
It looks like gsettings schema doesn't default searching in the users .local directory on Windows. We could override it there using the GSETTINGS_SCHEMA_DIR environmental variable. We could also copy it to the Gvsbuild share directory which it would search by default. |
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.
LGTM
This PR creates a new Preferences Window to allow users to override the system dark mode settings and also override the language to English.
Fixes #2586 and #2115
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Gaphor doesn't support any app wide preferences
Issue Number: N/A
What is the new behavior?
Gaphor has a minimum amount of preferences
Does this PR introduce a breaking change?
Other information