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.
This commit is contained in:
parent
23f910c149
commit
0afcb71122
2 changed files with 20 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue