From 9b3c204707dd09a1ae8f0763944fc8cf14221b75 Mon Sep 17 00:00:00 2001 From: Blackhive Date: Fri, 16 Jan 2015 03:06:54 -0500 Subject: [PATCH] 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. --- obs/window-basic-main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 450576ee9..f4d24a95c 100644 --- a/obs/window-basic-main.cpp +++ b/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"); qRegisterMetaType("OBSSceneItem"); qRegisterMetaType ("OBSSource");