From 2d6e2a85ee6784b8e4bbecc51768356ccfff51dc Mon Sep 17 00:00:00 2001 From: atauzki Date: Tue, 19 Nov 2024 20:41:13 +0800 Subject: [PATCH] feat: Windows, use Fusion only when dark mode applied --- src/main.cc | 2 +- src/ui/mainwindow.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 38fba190..1ecb0c95 100644 --- a/src/main.cc +++ b/src/main.cc @@ -368,7 +368,7 @@ int main( int argc, char ** argv ) #ifdef Q_OS_WIN // TODO: Force fusion because Qt6.7's "ModernStyle"'s dark theme have problems, need to test / reconsider in future - QHotkeyApplication::setStyle( QStyleFactory::create( "Fusion" ) ); + QHotkeyApplication::setStyle( QStyleFactory::create( "WindowsVista" ) ); #endif diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index e5e20916..677ef538 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -1356,8 +1356,10 @@ void MainWindow::updateAppearances( QString const & addonStyle, darkPalette.setColor( QPalette::Disabled, QPalette::HighlightedText, disabledColor ); qApp->setPalette( darkPalette ); + qApp->setStyle( "Fusion" ); } else { + qApp->setStyle( "WindowsVista" ); qApp->setPalette( QPalette() ); } #endif