diff options
author | saturneric <[email protected]> | 2025-05-01 00:23:24 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-05-01 00:23:24 +0000 |
commit | cd8124507237dda9066890748b7e0fbe59e7722d (patch) | |
tree | 0d2d5ca5b851fb7837fbb206320953d67e448db4 /src/ui/GpgFrontendUIInit.cpp | |
parent | fix: install and packaging on linux (diff) | |
download | GpgFrontend-cd8124507237dda9066890748b7e0fbe59e7722d.tar.gz GpgFrontend-cd8124507237dda9066890748b7e0fbe59e7722d.zip |
fix: should only use fusion as default style under app image env
Diffstat (limited to 'src/ui/GpgFrontendUIInit.cpp')
-rw-r--r-- | src/ui/GpgFrontendUIInit.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp index 03863516..498640c5 100644 --- a/src/ui/GpgFrontendUIInit.cpp +++ b/src/ui/GpgFrontendUIInit.cpp @@ -35,6 +35,7 @@ #include "core/function/GlobalSettingStation.h" #include "core/model/GpgPassphraseContext.h" #include "core/module/ModuleManager.h" +#include "core/utils/CommonUtils.h" #include "ui/UIModuleManager.h" #include "ui/UISignalStation.h" #include "ui/UserInterfaceUtils.h" @@ -123,13 +124,7 @@ void PreInitGpgFrontendUI() { "QWidget", {}); } -void InitGpgFrontendUI(QApplication* app) { - // init locale - InitUITranslations(); - - auto settings = GetSettings(); - auto theme = settings.value("appearance/theme").toString(); - +void SetFusionAsDefaultStyle() { // Set Fusion style for better dark mode support across platforms QApplication::setStyle(QStyleFactory::create("Fusion")); @@ -164,6 +159,17 @@ void InitGpgFrontendUI(QApplication* app) { // Apply the dark palette QApplication::setPalette(dark_palette); } +} + +void InitGpgFrontendUI(QApplication* app) { + // init locale + InitUITranslations(); + + auto settings = GetSettings(); + auto theme = settings.value("appearance/theme").toString(); + + // make appimage version look better + if (IsAppImageENV()) SetFusionAsDefaultStyle(); // If user has explicitly set a theme in settings, use that instead auto available_styles = QStyleFactory::keys(); |