]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/main.cpp
UrlNavigator: show a "lock" icon after the breadcrumb for read-only dir
[dolphin.git] / src / main.cpp
index e93ee43bc96535148e25bbee9ff0047c6f48d041..6df53b62ebe3c2405b8a10460f1dd945a5ff8e82 100644 (file)
@@ -22,6 +22,7 @@
 #include <KCrash>
 #include <KDBusService>
 #include <KIO/PreviewJob>
+#include <KIconTheme>
 #include <KLocalizedString>
 #include <KWindowSystem>
 
 #include <Kdelibs4ConfigMigrator>
 #endif
 
+#define HAVE_STYLE_MANAGER __has_include(<KStyleManager>)
+#if HAVE_STYLE_MANAGER
+#include <KStyleManager>
+#endif
+
 #include <QApplication>
 #include <QCommandLineParser>
 #include <QDBusConnection>
@@ -69,6 +75,13 @@ int main(int argc, char **argv)
     }
 #endif
 
+    /**
+     * trigger initialisation of proper icon theme
+     */
+#if KICONTHEMES_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+    KIconTheme::initTheme();
+#endif
+
     /**
      * enable high dpi support
      */
@@ -79,6 +92,21 @@ int main(int argc, char **argv)
     QApplication app(argc, argv);
     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
 
+#if HAVE_STYLE_MANAGER
+    /**
+     * trigger initialisation of proper application style
+     */
+    KStyleManager::initStyle();
+#else
+    /**
+     * For Windows and macOS: use Breeze if available
+     * Of all tested styles that works the best for us
+     */
+#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
+    QApplication::setStyle(QStringLiteral("breeze"));
+#endif
+#endif
+
     KCrash::initialize();
 
 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)