UI: Reset volume/media sliders on theme change
Since volume/media sliders are using QProxyStyle, they are not updated when themes are changed, so re-initialize them.master
parent
23f910c149
commit
0afcb71122
|
@ -474,6 +474,9 @@ OBSBasic::OBSBasic(QWidget *parent)
|
|||
connect(ui->broadcastButton, &QPushButton::clicked, this,
|
||||
&OBSBasic::BroadcastButtonClicked);
|
||||
|
||||
connect(App(), &OBSApp::StyleChanged, this,
|
||||
&OBSBasic::ResetProxyStyleSliders);
|
||||
|
||||
UpdatePreviewSafeAreas();
|
||||
UpdatePreviewSpacingHelpers();
|
||||
}
|
||||
|
@ -10233,3 +10236,19 @@ float OBSBasic::GetDevicePixelRatio()
|
|||
{
|
||||
return dpi;
|
||||
}
|
||||
|
||||
void OBSBasic::ResetProxyStyleSliders()
|
||||
{
|
||||
/* Since volume/media sliders are using QProxyStyle, they are not
|
||||
* updated when themes are changed, so re-initialize them. */
|
||||
vector<OBSSource> sources;
|
||||
for (size_t i = 0; i != volumes.size(); i++)
|
||||
sources.emplace_back(volumes[i]->GetSource());
|
||||
|
||||
ClearVolumeControls();
|
||||
|
||||
for (const auto &source : sources)
|
||||
ActivateAudioSource(source);
|
||||
|
||||
UpdateContextBar(true);
|
||||
}
|
||||
|
|
|
@ -806,6 +806,7 @@ private slots:
|
|||
void TBarReleased();
|
||||
|
||||
void LockVolumeControl(bool lock);
|
||||
void ResetProxyStyleSliders();
|
||||
|
||||
private:
|
||||
/* OBS Callbacks */
|
||||
|
|
Loading…
Reference in New Issue