mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-16 10:18:35 -05:00
UI: Fix mixer dock widget minSize being too big
When the vertical volume meter was introduced it set in the OBSBasic.ui mixer dock definition a min width/height that was valid for both widgets. QStackedWidget hints the minimum size as the higher w/h of its children so this workaround is necessary.
This commit is contained in:
@@ -1560,9 +1560,8 @@ void OBSBasic::OBSInit()
|
||||
}
|
||||
}
|
||||
|
||||
bool vertical = config_get_bool(App()->GlobalConfig(), "BasicWindow",
|
||||
"VerticalVolControl");
|
||||
ui->stackedMixerArea->setCurrentIndex(vertical);
|
||||
ToggleMixerLayout(config_get_bool(App()->GlobalConfig(), "BasicWindow",
|
||||
"VerticalVolControl"));
|
||||
|
||||
if (config_get_bool(basicConfig, "General", "OpenStatsOnStartup"))
|
||||
on_stats_triggered();
|
||||
@@ -2524,13 +2523,24 @@ void OBSBasic::StackedMixerAreaContextMenuRequested()
|
||||
popup.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void OBSBasic::ToggleMixerLayout(bool vertical)
|
||||
{
|
||||
if (vertical) {
|
||||
ui->stackedMixerArea->setMinimumSize(180, 220);
|
||||
ui->stackedMixerArea->setCurrentIndex(1);
|
||||
} else {
|
||||
ui->stackedMixerArea->setMinimumSize(220, 0);
|
||||
ui->stackedMixerArea->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::ToggleVolControlLayout()
|
||||
{
|
||||
bool vertical = !config_get_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"VerticalVolControl");
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow", "VerticalVolControl",
|
||||
vertical);
|
||||
ui->stackedMixerArea->setCurrentIndex(vertical);
|
||||
ToggleMixerLayout(vertical);
|
||||
|
||||
// We need to store it so we can delete current and then add
|
||||
// at the right order
|
||||
|
||||
Reference in New Issue
Block a user