feat: Windows, use Fusion only when dark mode applied
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run

This commit is contained in:
atauzki 2024-11-19 20:41:13 +08:00 committed by GitHub
parent 1fa0771716
commit 2d6e2a85ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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