Browse Source

UI: Enable load of stylesheet.qss from config dir

This will allow obs to load stylesheet.qss (Qt stylesheet). It enables
users to theme obs how they please within Qt stylesheet guidelines. A
default stylesheet is not yet available.
Blackhive 10 years ago
parent
commit
9b3c204707
1 changed files with 9 additions and 0 deletions
  1. 9 0
      obs/window-basic-main.cpp

+ 9 - 0
obs/window-basic-main.cpp

@@ -81,6 +81,15 @@ OBSBasic::OBSBasic(QWidget *parent)
 {
 	ui->setupUi(this);
 
+	char styleSheetPath[512];
+	int ret = os_get_config_path(styleSheetPath, sizeof(styleSheetPath),
+			"obs-studio/basic/stylesheet.qss");
+	if (ret > 0) {
+		QFile styleSheet(QT_UTF8(styleSheetPath));
+		if (styleSheet.open(QFile::ReadOnly))
+			setStyleSheet(styleSheet.readAll());
+	}
+
 	qRegisterMetaType<OBSScene>    ("OBSScene");
 	qRegisterMetaType<OBSSceneItem>("OBSSceneItem");
 	qRegisterMetaType<OBSSource>   ("OBSSource");