mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 15:10:06 +00:00
Change how new fusion styles are selected
This commit is contained in:
parent
5c57ae0edc
commit
57d65cf086
4 changed files with 71 additions and 10 deletions
|
|
@ -166,10 +166,24 @@ static void ConfigureTheme(const std::vector<std::string>& args)
|
|||
|
||||
QGuiApplication::styleHints()->setColorScheme(qtColorScheme);
|
||||
|
||||
if (uiStyle == scwx::qt::types::UiStyle::FusionQt6Ct)
|
||||
std::optional<std::string> paletteFile =
|
||||
scwx::qt::types::GetQtPaletteFile(uiStyle);
|
||||
if (paletteFile)
|
||||
{
|
||||
QPalette palette = Qt6CT::loadColorScheme(":res/qt6ct_colors/darker.conf",
|
||||
QApplication::style()->standardPalette());;
|
||||
QPalette defaultPalette = QApplication::style()->standardPalette();
|
||||
QPalette palette =
|
||||
Qt6CT::loadColorScheme(QString::fromStdString(*paletteFile),
|
||||
defaultPalette);
|
||||
|
||||
if (defaultPalette == palette)
|
||||
{
|
||||
logger_->warn("Failed to load palette file '{}'", *paletteFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger_->info("Loaded palette file '{}'", *paletteFile);
|
||||
}
|
||||
|
||||
QApplication::setPalette(palette);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue