Przeglądaj źródła

UI: Enforce completely Fusion Qt style on Linux

As of 8dcfae9a390763645d354700f36caef6b8f482c7, indicating the base
style to the proxy is completely functional.

It also bypasses QT_STYLE_OVERRIDE and -style, but since the system
theme is no longer available on Linux this is a non-issue.
tytan652 1 rok temu
rodzic
commit
34d577d748
3 zmienionych plików z 8 dodań i 6 usunięć
  1. 4 0
      UI/obs-app-theming.cpp
  2. 0 6
      UI/obs-app.cpp
  3. 4 0
      UI/obs-proxy-style.hpp

+ 4 - 0
UI/obs-app-theming.cpp

@@ -930,7 +930,11 @@ static map<string, string> themeMigrations = {
 bool OBSApp::InitTheme()
 {
 	defaultPalette = palette();
+#if !defined(_WIN32) && !defined(__APPLE__)
+	setStyle(new OBSProxyStyle("Fusion"));
+#else
 	setStyle(new OBSProxyStyle());
+#endif
 
 	/* Set search paths for custom 'theme:' URI prefix */
 	string searchDir;

+ 0 - 6
UI/obs-app.cpp

@@ -1987,12 +1987,6 @@ static int run_program(fstream &logFile, int argc, char *argv[])
 #endif
 
 #if !defined(_WIN32) && !defined(__APPLE__)
-	/* NOTE: The Breeze Qt style plugin adds frame arround QDockWidget with
-	 * QPainter which can not be modifed. To avoid this the base style is
-	 * enforce to the Qt default style on Linux: Fusion. */
-
-	setenv("QT_STYLE_OVERRIDE", "Fusion", false);
-
 	/* NOTE: Users blindly set this, but this theme is incompatble with Qt6 and
 	 * crashes loading saved geometry. Just turn off this theme and let users complain OBS
 	 * looks ugly instead of crashing. */

+ 4 - 0
UI/obs-proxy-style.hpp

@@ -4,6 +4,10 @@
 
 class OBSProxyStyle : public QProxyStyle {
 public:
+	OBSProxyStyle() : QProxyStyle() {}
+
+	OBSProxyStyle(const QString &key) : QProxyStyle(key) {}
+
 	int styleHint(StyleHint hint, const QStyleOption *option,
 		      const QWidget *widget,
 		      QStyleHintReturn *returnData) const override;