diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 2bbd655e..7dc0e80b 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -426,14 +426,18 @@ void MainWindow::draw() { int snrOffset = 87.0f * style::uiScale; int snrWidth = std::clamp(ImGui::GetWindowSize().x - ImGui::GetCursorPosX() - snrOffset, 100.0f * style::uiScale, 300.0f * style::uiScale); + int snrPos = std::max(ImGui::GetWindowSize().x - (snrWidth + snrOffset), ImGui::GetCursorPosX()); - ImGui::SetCursorPosX(ImGui::GetWindowSize().x - (snrWidth + snrOffset)); + ImGui::SetCursorPosX(snrPos); ImGui::SetCursorPosY(origY + (5.0f * style::uiScale)); ImGui::SetNextItemWidth(snrWidth); ImGui::SNRMeter((vfo != NULL) ? gui::waterfall.selectedVFOSNR : 0); + // Note: this is what makes the vertical size correct, needs to be fixed ImGui::SameLine(); + // ImGui::EndChild(); + // Logo button ImGui::SetCursorPosX(ImGui::GetWindowSize().x - (48 * style::uiScale)); ImGui::SetCursorPosY(10.0f * style::uiScale); @@ -447,8 +451,6 @@ void MainWindow::draw() { showCredits = false; } - // ImGui::EndChild(); - // Handle menu resize ImVec2 winSize = ImGui::GetWindowSize(); ImVec2 mousePos = ImGui::GetMousePos(); @@ -485,7 +487,7 @@ void MainWindow::draw() { if (showMenu) { ImGui::Columns(3, "WindowColumns", false); ImGui::SetColumnWidth(0, menuWidth); - ImGui::SetColumnWidth(1, winSize.x - menuWidth - (60.0f * style::uiScale)); + ImGui::SetColumnWidth(1, std::max(winSize.x - menuWidth - (60.0f * style::uiScale), 100.0f * style::uiScale)); ImGui::SetColumnWidth(2, 60.0f * style::uiScale); ImGui::BeginChild("Left Column");