UI: Add new theme, update theme capabilities

I have always felt that the out of the box themes for OBS were quite
lacking, and have spent a lot of time going through and sorting out the
difficulties with the current setup. I've added a new themeID parameter to
several elements that were otherwise impossible to target with QSS in a
theme. Since Qt has pushed for the use of QML over QSS at this point,
these should be considered workarounds. Included is the theme I was
working on that can serve as a base. I'm hoping to encourage others to
make their own themes, so we can grow the available themes for OBS.

I am happy for any feedback on the theme itself, or other updates that
can me made to make creating new themes easier overall.
This commit is contained in:
Joel Bethke 2017-06-13 14:34:05 -05:00
parent f093028d7a
commit 432e285257
25 changed files with 1031 additions and 0 deletions

1021
UI/data/themes/Rachni.qss Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

View File

@ -272,10 +272,12 @@ void OBSHotkeyWidget::AddEdit(obs_key_combination combo, int idx)
edit->setToolTip(toolTip);
auto revert = new QPushButton;
revert->setProperty("themeID", "hotkeyButtons");
revert->setText(QTStr("Revert"));
revert->setEnabled(false);
auto clear = new QPushButton;
clear->setProperty("themeID", "hotkeyButtons");
clear->setText(QTStr("Clear"));
clear->setEnabled(!obs_key_combination_is_empty(combo));
@ -287,10 +289,12 @@ void OBSHotkeyWidget::AddEdit(obs_key_combination combo, int idx)
});
auto add = new QPushButton;
add->setProperty("themeID", "hotkeyButtons");
add->setText("+");
add->setMinimumWidth(50);
auto remove = new QPushButton;
remove->setProperty("themeID", "hotkeyButtons");
remove->setText("-");
remove->setEnabled(removeButtons.size() > 0);
remove->setMinimumWidth(50);

View File

@ -296,6 +296,7 @@ void OBSPropertiesView::AddPath(obs_property_t *prop, QFormLayout *layout,
button->setEnabled(false);
}
button->setProperty("themeID", "settingsButtons");
edit->setText(QT_UTF8(val));
edit->setReadOnly(true);
edit->setToolTip(QT_UTF8(obs_property_long_description(prop)));
@ -610,6 +611,7 @@ QWidget *OBSPropertiesView::AddButton(obs_property_t *prop)
const char *desc = obs_property_description(prop);
QPushButton *button = new QPushButton(QT_UTF8(desc));
button->setProperty("themeID", "settingsButtons");
button->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
return NewWidget(prop, button, SIGNAL(clicked()));
}
@ -628,6 +630,7 @@ void OBSPropertiesView::AddColor(obs_property_t *prop, QFormLayout *layout,
colorLabel->setEnabled(false);
}
button->setProperty("themeID", "settingsButtons");
button->setText(QTStr("Basic.PropertiesWindow.SelectColor"));
button->setToolTip(QT_UTF8(obs_property_long_description(prop)));
@ -698,6 +701,7 @@ void OBSPropertiesView::AddFont(obs_property_t *prop, QFormLayout *layout,
font = fontLabel->font();
MakeQFont(font_obj, font, true);
button->setProperty("themeID", "settingsButtons");
button->setText(QTStr("Basic.PropertiesWindow.SelectFont"));
button->setToolTip(QT_UTF8(obs_property_long_description(prop)));
@ -1795,6 +1799,7 @@ public:
if (browse) {
QPushButton *browseButton =
new QPushButton(QTStr("Browse"));
browseButton->setProperty("themeID", "settingsButtons");
topLayout->addWidget(browseButton);
topLayout->setAlignment(browseButton, Qt::AlignVCenter);

View File

@ -1213,6 +1213,7 @@ void OBSBasic::ResetOutputs()
this,
&OBSBasic::ReplayBufferClicked);
replayBufferButton->setProperty("themeID", "replayBufferButton");
ui->buttonsVLayout->insertWidget(2, replayBufferButton);
}