Skip to content

Commit fc7d384

Browse files
committed
[WIP] Finish remaining TODOs
1 parent 79b0cea commit fc7d384

File tree

10 files changed

+39
-23
lines changed

10 files changed

+39
-23
lines changed

frontend/settings/OBSBasicSettings_A11y.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void OBSBasicSettings::SaveA11ySettings()
111111
config_set_int(config, "Accessibility", "MixerYellowActive", mixerYellowActive);
112112
config_set_int(config, "Accessibility", "MixerRedActive", mixerRedActive);
113113

114-
// TODO: FIXME main->refreshVolumeColors();
114+
emit main->userSettingChanged("Accessibility", "SettingsChanged");
115115
}
116116

117117
static void SetStyle(QLabel *label, uint32_t colorVal)

frontend/widgets/AudioMixer.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ AudioMixer::AudioMixer(QWidget *parent) : QFrame(parent)
250250
updateShowHidden();
251251
} else if (category == "BasicWindow" && name == "MixerKeepHiddenRight") {
252252
updateKeepHiddenRight();
253+
} else if (category == "BasicWindow" && name == "ShowListboxToolbars") {
254+
updateShowToolbar();
255+
} else if (category == "Accessibility" && name == "SettingsChanged") {
256+
refreshVolumeColors();
253257
}
254258
});
255259

@@ -261,6 +265,7 @@ AudioMixer::AudioMixer(QWidget *parent) : QFrame(parent)
261265
connect(layoutButton, &QAction::triggered, main, &OBSBasic::toggleMixerLayout);
262266
}
263267

268+
updateShowToolbar();
264269
updatePreviewSources();
265270
updateGlobalSources();
266271

@@ -922,6 +927,19 @@ void AudioMixer::updateKeepHiddenRight()
922927
queueLayoutUpdate();
923928
}
924929

930+
void AudioMixer::updateShowToolbar()
931+
{
932+
bool settingShowToolbar = config_get_bool(App()->GetUserConfig(), "BasicWindow", "ShowListboxToolbars");
933+
934+
if (showToolbar == settingShowToolbar) {
935+
return;
936+
}
937+
938+
showToolbar = settingShowToolbar;
939+
940+
showToolbar ? mixerToolbar->show() : mixerToolbar->hide();
941+
}
942+
925943
void AudioMixer::obsSourceActivated(void *data, calldata_t *params)
926944
{
927945
obs_source_t *source = (obs_source_t *)calldata_ptr(params, "source");

frontend/widgets/AudioMixer.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class AudioMixer : public QFrame {
6969
bool keepInactiveRight = false;
7070
bool keepHiddenRight = false;
7171

72+
bool showToolbar = true;
73+
7274
QFrame *mixerFrame = nullptr;
7375
QVBoxLayout *mainLayout = nullptr;
7476
QVBoxLayout *mixerLayout = nullptr;
@@ -106,6 +108,7 @@ class AudioMixer : public QFrame {
106108
void updateKeepInactiveRight();
107109
void updateShowHidden();
108110
void updateKeepHiddenRight();
111+
void updateShowToolbar();
109112

110113
QTimer updateTimer;
111114
void updateVolumeLayouts();

frontend/widgets/OBSBasic_ContextToolbar.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,6 @@ void OBSBasic::copyActionsDynamicProperties()
5757
temp->setProperty(y, x->property(y));
5858
}
5959
}
60-
// TODO: FIXME
61-
/*
62-
for (QAction *x : ui->mixerToolbar->actions()) {
63-
QWidget *temp = ui->mixerToolbar->widgetForAction(x);
64-
65-
if (!temp)
66-
continue;
67-
68-
for (QByteArray &y : x->dynamicPropertyNames()) {
69-
temp->setProperty(y, x->property(y));
70-
}
71-
}
72-
*/
7360
}
7461

7562
void OBSBasic::ClearContextBar()

frontend/widgets/OBSBasic_MainControls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ void OBSBasic::on_toggleListboxToolbars_toggled(bool visible)
520520
{
521521
ui->sourcesToolbar->setVisible(visible);
522522
ui->scenesToolbar->setVisible(visible);
523-
// TODO: FIXME ui->mixerToolbar->setVisible(visible);
524523

525524
config_set_bool(App()->GetUserConfig(), "BasicWindow", "ShowListboxToolbars", visible);
525+
emit userSettingChanged("BasicWindow", "ShowListboxToolbars");
526526
}
527527

528528
void OBSBasic::on_toggleStatusBar_toggled(bool visible)

frontend/widgets/OBSBasic_Profiles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ void OBSBasic::ActivateProfile(const OBSProfile &profile, bool reset)
706706
RefreshProfiles();
707707

708708
UpdateTitleBar();
709-
// TODO: FIXME updateDecayRate();
709+
emit profileSettingChanged("Audio", "MeterDecayRate");
710710

711711
Auth::Load();
712712
#ifdef YOUTUBE_ENABLED

frontend/widgets/OBSBasic_SceneCollections.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,6 @@ void OBSBasic::ClearSceneData()
14941494

14951495
CloseDialogs();
14961496

1497-
// TODO: FIXME clearVolumeControls();
14981497
ClearListItems(ui->scenes);
14991498
ui->sources->Clear();
15001499
ClearQuickTransitions();

frontend/widgets/VolControl.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -973,12 +973,7 @@ void VolControl::setHideInMixer(bool hidden)
973973

974974
void VolControl::refreshColors()
975975
{
976-
volMeter->setBackgroundNominalColor(volMeter->getBackgroundNominalColor());
977-
volMeter->setBackgroundWarningColor(volMeter->getBackgroundWarningColor());
978-
volMeter->setBackgroundErrorColor(volMeter->getBackgroundErrorColor());
979-
volMeter->setForegroundNominalColor(volMeter->getForegroundNominalColor());
980-
volMeter->setForegroundWarningColor(volMeter->getForegroundWarningColor());
981-
volMeter->setForegroundErrorColor(volMeter->getForegroundErrorColor());
976+
volMeter->refreshColors();
982977
}
983978

984979
void VolControl::debugHideControls()

frontend/widgets/VolumeMeter.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,18 @@ void VolumeMeter::setMuted(bool mute)
456456
muted = mute;
457457
}
458458

459+
void VolumeMeter::refreshColors()
460+
{
461+
setBackgroundNominalColor(getBackgroundNominalColor());
462+
setBackgroundWarningColor(getBackgroundWarningColor());
463+
setBackgroundErrorColor(getBackgroundErrorColor());
464+
setForegroundNominalColor(getForegroundNominalColor());
465+
setForegroundWarningColor(getForegroundWarningColor());
466+
setForegroundErrorColor(getForegroundErrorColor());
467+
468+
updateBackgroundCache();
469+
}
470+
459471
// When this is called from the constructor, obs_volmeter_get_nr_channels has not
460472
// yet been called and Q_PROPERTY settings have not yet been read from the
461473
// stylesheet.

frontend/widgets/VolumeMeter.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ class VolumeMeter : public QWidget {
147147
void setUseDisabledColors(bool enable);
148148
void setMuted(bool mute);
149149

150+
void refreshColors();
151+
150152
QColor getBackgroundNominalColor() const;
151153
void setBackgroundNominalColor(QColor c);
152154
QColor getBackgroundWarningColor() const;

0 commit comments

Comments
 (0)