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.
This commit is contained in:
Blackhive
2015-01-16 03:06:54 -05:00
committed by jp9000
parent 471d87c940
commit 9b3c204707

View File

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