UI: Enforce completely Fusion Qt style on Linux

As of 8dcfae9a39, 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.
This commit is contained in:
tytan652 2024-05-24 10:35:18 +02:00 committed by Lain
parent 76bde59e22
commit 34d577d748
3 changed files with 8 additions and 6 deletions

View file

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

View file

@ -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. */

View file

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