diff --git a/UI/forms/OBSBasic.ui b/UI/forms/OBSBasic.ui index 103db2c58..9dae6fe2f 100644 --- a/UI/forms/OBSBasic.ui +++ b/UI/forms/OBSBasic.ui @@ -617,12 +617,6 @@ - - - 175 - 220 - - Qt::CustomContextMenu diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 84977f8a7..87479f297 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -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 diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index 6abab8ae5..5dce75682 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -252,6 +252,7 @@ private: void GetAudioSourceProperties(); void VolControlContextMenu(); void ToggleVolControlLayout(); + void ToggleMixerLayout(bool vertical); void RefreshSceneCollections(); void ChangeSceneCollection();