Synchronize system accent color avilability between toggle and setting

This commit is contained in:
Ilya Fedin
2026-04-19 15:50:56 +00:00
committed by John Preston
parent 02f0d7bb8a
commit 786e8999e1
2 changed files with 6 additions and 5 deletions
@@ -99,11 +99,7 @@ const auto kSchemesList = Window::Theme::EmbeddedThemes();
constexpr auto kCustomColorButtonParts = 7;
[[nodiscard]] bool IsSystemAccentColorSupported() {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return true;
#else
return !Platform::IsWindows() || !Platform::IsWindows8OrGreater();
#endif
return Window::Theme::SystemAccentColor().has_value();
}
class ColorsPalette final {
@@ -179,6 +179,11 @@ style::colorizer ColorizerFrom(
}
std::optional<QColor> SystemAccentColor() {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (Platform::IsWindows() && !Platform::IsWindows8OrGreater()) {
return std::nullopt;
}
#endif // Qt < 6.0.0
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
constexpr auto kAccentRole = QPalette::ColorRole::Accent;
#else