mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Synchronize system accent color avilability between toggle and setting
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user