UI: Apply a style sheet using path
This allows the usage of other resources in the style sheet, like icons/etc, relative to the style sheet location. For example, to change the main window app icon, add #OBSBasic { qproperty-windowIcon: url("basic/newicon.png") } in the style sheet, where "basic/newicon.png" is a path relative to the qss file location.
This commit is contained in:
parent
4093ce4d84
commit
0fea987ed4
@ -85,9 +85,11 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
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());
|
||||
if (QFile::exists(styleSheetPath)) {
|
||||
QString path = QString("file:///") +
|
||||
QT_UTF8(styleSheetPath);
|
||||
App()->setStyleSheet(path);
|
||||
}
|
||||
}
|
||||
|
||||
qRegisterMetaType<OBSScene> ("OBSScene");
|
||||
|
Loading…
x
Reference in New Issue
Block a user