From 5d08f1018d0e02324610afe25848f9afd763f2fd Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Thu, 29 Jul 2021 17:58:23 +0200 Subject: [PATCH] Partial fix for the SNR meter not being the right size --- core/src/config.h | 1 - core/src/gui/main_window.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/config.h b/core/src/config.h index c1bec25..e6bf10a 100644 --- a/core/src/config.h +++ b/core/src/config.h @@ -4,7 +4,6 @@ #include #include #include -#include using nlohmann::json; diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 513a646..a7c9b61 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -404,9 +404,11 @@ void MainWindow::draw() { ImGui::SameLine(); - ImGui::SetCursorPosX(ImGui::GetWindowSize().x - 387); + int snrWidth = std::min(300, ImGui::GetWindowSize().x - ImGui::GetCursorPosX() - 87); + + ImGui::SetCursorPosX(ImGui::GetWindowSize().x - (snrWidth+87)); ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5); - ImGui::SetNextItemWidth(300); + ImGui::SetNextItemWidth(snrWidth); ImGui::SNRMeter((vfo != NULL) ? gui::waterfall.selectedVFOSNR : 0); ImGui::SameLine();