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.
1021
UI/data/themes/Rachni.qss
Normal file
BIN
UI/data/themes/Rachni/checkbox_checked.png
Normal file
After Width: | Height: | Size: 281 B |
BIN
UI/data/themes/Rachni/checkbox_checked_disabled.png
Normal file
After Width: | Height: | Size: 491 B |
BIN
UI/data/themes/Rachni/checkbox_checked_focus.png
Normal file
After Width: | Height: | Size: 281 B |
BIN
UI/data/themes/Rachni/checkbox_unchecked.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
UI/data/themes/Rachni/checkbox_unchecked_disabled.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
UI/data/themes/Rachni/checkbox_unchecked_focus.png
Normal file
After Width: | Height: | Size: 275 B |
BIN
UI/data/themes/Rachni/down_arrow.png
Normal file
After Width: | Height: | Size: 165 B |
BIN
UI/data/themes/Rachni/down_arrow_disabled.png
Normal file
After Width: | Height: | Size: 166 B |
BIN
UI/data/themes/Rachni/left_arrow.png
Normal file
After Width: | Height: | Size: 166 B |
BIN
UI/data/themes/Rachni/left_arrow_disabled.png
Normal file
After Width: | Height: | Size: 166 B |
BIN
UI/data/themes/Rachni/radio_checked.png
Normal file
After Width: | Height: | Size: 940 B |
BIN
UI/data/themes/Rachni/radio_checked_disabled.png
Normal file
After Width: | Height: | Size: 972 B |
BIN
UI/data/themes/Rachni/radio_checked_focus.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
UI/data/themes/Rachni/radio_unchecked.png
Normal file
After Width: | Height: | Size: 728 B |
BIN
UI/data/themes/Rachni/radio_unchecked_disabled.png
Normal file
After Width: | Height: | Size: 760 B |
BIN
UI/data/themes/Rachni/radio_unchecked_focus.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
UI/data/themes/Rachni/right_arrow.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
UI/data/themes/Rachni/right_arrow_disabled.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
UI/data/themes/Rachni/sizegrip.png
Normal file
After Width: | Height: | Size: 129 B |
BIN
UI/data/themes/Rachni/up_arrow.png
Normal file
After Width: | Height: | Size: 158 B |
BIN
UI/data/themes/Rachni/up_arrow_disabled.png
Normal file
After Width: | Height: | Size: 159 B |
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1213,6 +1213,7 @@ void OBSBasic::ResetOutputs()
|
||||
this,
|
||||
&OBSBasic::ReplayBufferClicked);
|
||||
|
||||
replayBufferButton->setProperty("themeID", "replayBufferButton");
|
||||
ui->buttonsVLayout->insertWidget(2, replayBufferButton);
|
||||
}
|
||||
|
||||
|