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:
parent
5262fa31c0
commit
6a16778bc9
9 changed files with 154 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue