UI: Implement theme selection option

OBS will offer the user a list of themes which are .qss files inside
data/obs-studio/themes.  If no theme is found in the configuration, it
loads the default theme for the system.
This commit is contained in:
Socapex 2015-02-17 02:45:34 -05:00 • committed by jp9000
commit 6a16778bc9
9 changed files with 154 additions and 7 deletions

View file

@ -82,6 +82,7 @@ OBSBasic::OBSBasic(QWidget *parent)
ui (new Ui::OBSBasic)
{
ui->setupUi(this);
copyActionsDynamicProperties();
int width = config_get_int(App()->GlobalConfig(), "MainWindow", "cx");
@ -197,6 +198,26 @@ static obs_data_t *GenerateSaveData()
return saveData;
}
void OBSBasic::copyActionsDynamicProperties()
{
// Themes need the QAction dynamic properties
for (QAction *x : ui->scenesToolbar->actions()) {
QWidget* temp = ui->scenesToolbar->widgetForAction(x);
for (QByteArray &y : x->dynamicPropertyNames()) {
temp->setProperty(y, x->property(y));
}
}
for (QAction *x : ui->sourcesToolbar->actions()) {
QWidget* temp = ui->sourcesToolbar->widgetForAction(x);
for (QByteArray &y : x->dynamicPropertyNames()) {
temp->setProperty(y, x->property(y));
}
}
}
void OBSBasic::ClearVolumeControls()
{
VolControl *control;