Commit Graph

544 Commits

Author SHA1 Message Date
Martchus f69ffec06c Allow tracking whether the locale has changed via the `QtSettings` class
This allows an application to reload translations if the default locale has
changed to apply locale changes dynamically.
2023-07-02 23:48:46 +02:00
Martchus f30d020cda Update translations 2023-07-02 17:12:32 +02:00
Martchus dd99862769 Make the settings dialog react to language changes
This covers the settings dialog itself and option pages based on
`UiFileBasedOptionPage`. Other option pages need to react to the
new `OptionPageWidget::retranslationRequired()` signal or handle
the `QEvent::LanguageChange` event which is now propageted to the
page's widget.
2023-07-02 17:12:32 +02:00
Martchus bc3f84e65d Apply clang-format 2023-07-01 23:43:46 +02:00
Martchus 8fd1452174 Allow clearing previously installed translation files 2023-07-01 23:43:27 +02:00
Martchus 8d8585d00d Allow to instantiate built-in option pages individually
Expose conversion from QtSettings to QtSettingsData so one can pass such
an object to the constructor of e.g. QtLanguageOptionPage.
2023-06-26 21:22:42 +02:00
Martchus 3ac8c8e1a4 Update minor version 2023-06-26 21:22:42 +02:00
Martchus 96f10766d4 Enable web view support only by default if Qt WebEngine is present
The web view is only an optional enhancement in my applications so having
the support disabled is rather common. So for a better out-of-the-box
experience when configuring my projects it makes sense not having to
disable web view support explicitly if Qt WebEngine is not installed
anyways.
2023-06-10 18:08:13 +02:00
Martchus defecc45bc Fix showing font dialog 2023-06-09 12:28:26 +02:00
Martchus 0a952a2093 Bump patch version 2023-06-09 12:27:25 +02:00
Martchus fecf24a845 Update translations 2023-06-08 16:58:12 +02:00
Martchus cc05211664 Fix applying certain color roles when loading palette from file 2023-06-08 16:42:09 +02:00
Martchus c528926ce6 Remove useless function from palette editor 2023-06-08 16:21:50 +02:00
Martchus 0e7c10e622 Apply clang-format 2023-06-08 15:33:15 +02:00
Martchus 474af5eed9 Update translations 2023-06-08 14:04:55 +02:00
Martchus 3fffbc26e8 Fix selecting custom palette
For some reason the tool button's palette changes back to the old palette
when applying changes. So it cannot be used to hold the intermediately
selected paletted.
2023-06-08 13:28:35 +02:00
Martchus 958d7bc7c9 Bump patch version 2023-06-08 13:22:00 +02:00
Martchus 7dab696f42 Update translations 2023-05-21 20:12:41 +02:00
Martchus acecbd1158 Fix warnings about cv qualifiers droped from `static_cast` return type
The change for avoiding a warning from MSVC about 64-bit shift operations
introduced a different warning from GCC. Hopefully this now avoids warnings
in all compilers.
2023-05-21 19:00:36 +02:00
Martchus 03a3867688 Fix warning from MSVC about 64-bit shift operations 2023-05-10 22:07:39 +02:00
Martchus 6e4ea3652c Build CLI wrappers for Qt applications by default
Most of my Qt apps provide at least a basic CLI as well so providing the
CLI wrapper by default makes most sense.
2023-05-07 21:41:47 +02:00
Martchus a91c015e1c Bump patch version 2023-05-07 21:41:47 +02:00
Martchus 6974beab8a Update translations 2023-04-02 18:29:17 +02:00
Martchus 92c643f5ff Apply clang-format 2023-04-02 18:29:01 +02:00
Martchus 0ce5be5b2f Use Fusion by default on Windows 11
The native Windows style doesn't look very nice
on Windows 11 so Fusion looks better in comparison,
see https://bugreports.qt.io/browse/QTBUG-97668.
2023-03-28 23:42:13 +02:00
Martchus 63b33810e5 Allow disabling notices in Qt settings option pages 2023-03-26 21:24:43 +02:00
Martchus bd1e603fcf Improve behavior of `QtSettings::apply()` to be called multiple times
* Restore default settings
* Remove previously configured paths
2023-03-26 21:05:13 +02:00
Martchus 3e0754ebe5 Use fully qualified type in signal signature of `OptionCategory` 2023-03-26 19:51:50 +02:00
Martchus f27288fb1f Pass context object in lambda connections in `qtsettings.cpp` 2023-03-26 19:42:25 +02:00
Martchus 121d6a10db Fix return type of `dialogStyleForPalette()` for Windows implementation 2023-03-26 19:37:13 +02:00
Martchus 8642f14bb1 Apply clang-format and cmake-format 2023-03-25 18:50:08 +01:00
Martchus 41a1ede6fc Improve handling style changes in custom dialog style
* Avoid using global palette when computing stylesheet
* Re-compute stylesheet on palette changes
2023-03-25 18:49:43 +01:00
Martchus bbb65ae0dd Add function to re-evaluate the palette and default icon theme 2023-03-23 22:40:42 +01:00
Martchus 5430edc5fc Avoid running expensive icon-bundling code on every CMake re-configuration 2023-03-23 22:08:57 +01:00
Martchus 0e151b3cc6 Avoid relying on external tool for working around CMake's broken `REALPATH` 2023-03-23 21:48:59 +01:00
Martchus c2bd68824c Workaround broken `get_filename_component(... REALPATH)` on Windows
See https://gitlab.kitware.com/cmake/cmake/-/issues/17206
2023-03-16 00:50:50 +01:00
Martchus dd3ae7b32b Make search path for icon themes configurable 2023-03-16 00:48:11 +01:00
Martchus b8a428f29f Update translations 2023-03-15 21:29:30 +01:00
Martchus 9f4c7a8aaa Use `PLATFORM_WINDOWS` (and not `PLATFORM_MINGW`) in conversion functions
Whether MinGW (or MSVC) is used shouldn't make a difference here. The code
using these functions generally sticks to UTF-8 on Windows.
2023-03-15 21:29:14 +01:00
Martchus 647ad121a5 Improve setting default icon theme
* Set the default icon theme when applying Qt settings and the "system"
  theme is supposed to be used but none could be determined by Qt
    * Use a bundled icon theme depending on whether the current palette is
      light or dark
* Apply the default not only under Windows anymore; supposedly this makes
  sense under any platform where Qt cannot determine the icon theme for us
2023-03-15 21:27:04 +01:00
Martchus 54650eb2af Improve setting icon theme from CLI arguments
* Use `qEnvironmentVariable()` to read env variables into `QString`s
* Treat CLI arguments as UTF-8 (they will be converted to UTF-8 on Windows)
  which is consistent with the CLI argument handling in tag editor
* Add comment about processing of `m_iconThemeArg` and reserve the correct
  size when building the `QStringLiteral`
2023-03-15 20:07:10 +01:00
Martchus e5bd602d91 Ensure environment settings are effective before applying other settings
At least the documentation of `QIcon::setThemeName()` sounds like it could
make a difference:
```
The name should correspond to a directory name in the themeSearchPath() …
```
2023-03-15 19:31:09 +01:00
Martchus fd151995ce Adapt to dark mode support in Qt 6.5
* Avoid setting platform setting in Qt 6.5 as it is no longer needed for
  dark Window frames
* Reference recent blog post
* Add real `isDarkModeEnabled()` function using new Qt 6.5 API (as existing
  `isPaletteDark()` function is only based on the current palette)
2023-03-13 20:59:57 +01:00
Martchus 89bbd75950 Bump minor version 2023-03-13 20:23:28 +01:00
Martchus 368c9e9b0e Add function to return an error message for a `QSettings` object 2023-02-17 19:17:17 +01:00
Martchus 6e52b62706 Bump minor version 2023-02-17 19:16:30 +01:00
Martchus 2f46ecfbf4 Update translations 2023-02-11 16:21:35 +01:00
Martchus 1dded32095 Avoid assigning wrong window icon to settings tab with no icon
* Reset the settings page's widget's parent so `windowIcon()` won't return
  the parent's icon
* Improve the coding style a little bit
2023-02-11 16:21:19 +01:00
Martchus 41ddfc08b7 Update copyright notice 2023-01-17 18:34:58 +01:00
Martchus a051af49ae Avoid warning about unqualified std cast 2022-11-04 16:50:33 +01:00