Add an initial version of a preferences dialog - #2261
Conversation
- Use the libadwaita preferences dialog, and define the layout using an xml .ui file to test out this process for the first time. - Move the color scheme preference into the dialog as a test. By adding an event when settings are modified, changes to the settings can be decoupled from the dialog itself - Add a Preferences menu item. Depending on the platform, this is in the application menu on macOS, or in the Edit menu for a menubar layout, or in the main menu when using a headerbar layout. - Also simplified logic around how the macOS app menu commands are registered, and fixed the keyboard shortcut dialog to use different shortcuts from the prefs dialog
|
Great that you like the UI files 👍 If your solution for translations can be supported by GirCore we can try to upstream it or parts of it. There is already a ticket to improve the UI file translation situation but without any concrete idea yet: gircore/gir.core#1482 |
|
One option would be to extend the The other approach I've been looking at is just having Pinta use the native We already bundle libintl since it's used by GTK, libadwaita, etc, so using this is pretty reasonable and just requires a few bindings for the native functions. The |
|
I think you can already provide custom resource loaders so influencing the xml is already possible. Adding another configuration point inside it feels a little much to me. It sounds pretty great to use the gettext package. One idea which came to my mind is to just let the user use an attribute on assembly level like In this way if you call it everything gets setup automatically including language and subclass registration. |
Description of Changes
Use the libadwaita preferences dialog, and define the layout using a
.uifile to test out this process for the first time (works quite well!).Move the color scheme preference into the dialog as a test. By adding an event when settings are modified, changes to the settings can be decoupled from the dialog itself
Add a Preferences menu item. Depending on the platform, this is in the application menu on macOS, or in the Edit menu for a menubar layout on other platforms, or in the main menu when using a headerbar layout.
TODO: figure out how to translate the .ui file. If we used the native gettext library for our translations this would just work automatically, so perhaps we should attempt to do this? Otherwise we need to implement a custom loader which translates the xml file using our
Translations.GetString()functionChecklist