Commit Graph

44 Commits

Author SHA1 Message Date
Martchus a7d2611400 Allow re-applying the default icon theme independently of palette
This is useful under Android where the palette is apparently not set to
something matching the darkmode setting but the Qt Quick Material style
nevertheless seems to follow the darkmode setting. So we just want to take
the darkmode setting into account for assigning the appropriate icon theme
and ignore the palette.
2024-03-31 13:42:38 +02:00
Martchus 63ffbc4a6f Avoid warning after `QOperatingSystemVersion::OSType` was moved
This is now `QOperatingSystemVersionBase::OSType` causing a warning about
an implicit conversion. Making an explicit cast to whatever type
`os.type()` actually returns (depends on the Qt version) this warning does
not occur anymore and the code should still compile with any Qt version.
2024-03-15 23:54:17 +01:00
Martchus 010f5d8408 No longer enforce Fusion style on Windows 11 as of Qt 6.7
It looks like Qt 6.7 is going to provide a style for Windows 11 that will
fix the mentioned bug.
2023-12-15 15:56:09 +01:00
Martchus c347bbfe1f Fix compilation against Qt < 6.1 2023-10-29 21:23:01 +01:00
Martchus 458d98a279 Allow logging a few useful Qt-related information by setting env variable
Log Qt-related info when the environment variable
QT_UTILITIES_LOG_QT_CONFIG is set.
2023-10-14 20:44:59 +02:00
Martchus dcc6f71f1e Avoid unqualified `std` calls in `qtsettings.cpp` 2023-10-14 20:09:31 +02:00
Martchus a1f50456e8 Use `QLocale::territory()` instead of deprecated `QLocale::country()` 2023-10-14 20:03:37 +02:00
Martchus c7426403e5 Allow configuring notice on localization option page individually
Whether an application can retranslate the UI dynamically likely differs
from whether the other appearance related settings can be applied
dynamically so this needs to be configurable individually.

Additionally, the environment settings can never be applied dynamically so
the notice on that page should always be shown.
2023-07-03 00:21:29 +02:00
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 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 defecc45bc Fix showing font dialog 2023-06-09 12:28:26 +02:00
Martchus 0e7c10e622 Apply clang-format 2023-06-08 15:33:15 +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 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 f27288fb1f Pass context object in lambda connections in `qtsettings.cpp` 2023-03-26 19:42:25 +02:00
Martchus 8642f14bb1 Apply clang-format and cmake-format 2023-03-25 18:50:08 +01:00
Martchus bbb65ae0dd Add function to re-evaluate the palette and default icon theme 2023-03-23 22:40:42 +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 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 d4e35c28a3 Fix typo 2022-06-09 20:19:27 +02:00
Martchus 6564932b64 Fix applying selected custom font 2022-05-01 21:57:59 +02:00
Martchus a2482ef37c Avoid several warnings when building against Qt 6 2021-11-04 00:06:15 +01:00
Martchus 7765e6f062 Fix typos found via `codespell --skip .git -w` 2021-07-03 19:14:13 +02:00
Martchus cb3a4960e7 Support Qt 6 (commit 174154b) 2020-09-04 00:44:48 +02:00
Martchus 9908190722 Use make_unique in qtsettings.cpp 2019-08-10 21:51:05 +02:00
Martchus b3e7c390d9 Have everything in one top-level namespace 2019-06-10 21:57:46 +02:00
Martchus e12c60b594 Reduce padding of QtSettingsData 2018-08-12 22:12:16 +02:00
Martchus da485f5702 Don't reset or apply option pages which haven't been shown
This makes the annoying hasBeenShown() check in each apply()
and reset() implementation unnecessary. It should not break
anything because if the page hasn't been shown there is nothing
to reset/apply anyways.
2017-09-27 00:20:43 +02:00
Martchus afe3373896 Apply tidy after updating to clang-format 5.0.0
The behavior of clang-format slightly changed in Clang 5.0.0:
http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
2017-09-17 21:45:49 +02:00
Martchus 0599eb354d Apply clang-format 2017-05-04 22:46:37 +02:00
Martchus 2dcbc02f4b Apply clang-format 2017-05-01 03:16:25 +02:00
Martchus 93245e9e0c Handle errors when applying Qt settings 2017-03-06 22:13:58 +01:00
Martchus 74aa4316b1 Use std::make_unique provided by C++14 2017-02-05 21:03:01 +01:00
Martchus 086ff0b409 Fix customizing locale 2017-01-07 16:56:24 +01:00
Martchus f50f35ddc8 Add German translation 2017-01-07 16:46:53 +01:00
Martchus 72296a2768 Improve settings dialog 2016-08-27 15:18:44 +02:00
Martchus 55ad0b4de1 Improve icons
- Provide fallback for Qt icon
- Ensure default search paths are not overwritten
2016-08-17 20:05:48 +02:00
Martchus de98b88f4a Improve Qt settings
Setting font and icon theme doesn't work yet, not sure
about locale
2016-08-14 22:44:25 +02:00
Martchus 31ed859555 ensure templates are instantiated 2016-04-16 19:19:27 +02:00
Martchus aa880c3ed5 further development of Qt settings 2016-04-09 02:33:45 +02:00
Martchus 87fd94a2e0 improved settings dialog API 2016-04-04 14:49:40 +02:00