From 8b515dd3d2e086e8c666e9788ec8959e5452ccb5 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 27 Nov 2021 10:27:34 -0600 Subject: [PATCH] Fixing intermittent elevation button resize issue --- scwx-qt/source/scwx/qt/main/main_window.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index bfa2c562..994bb87d 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -56,6 +56,7 @@ public: std::vector maps_; std::vector elevationCuts_; + bool elevationButtonsChanged_; bool resizeElevationButtons_; public slots: @@ -123,7 +124,11 @@ bool MainWindow::event(QEvent* event) { if (event->type() == QEvent::Type::Paint) { - if (p->resizeElevationButtons_) + if (p->elevationButtonsChanged_) + { + p->elevationButtonsChanged_ = false; + } + else if (p->resizeElevationButtons_) { // Set each elevation cut's tool button to the same size int elevationCutMaxWidth = 0; @@ -367,8 +372,9 @@ void MainWindowImpl::UpdateRadarProductSettings() }); } - elevationCuts_ = elevationCuts; - resizeElevationButtons_ = true; + elevationCuts_ = elevationCuts; + elevationButtonsChanged_ = true; + resizeElevationButtons_ = true; } UpdateElevationSelection(currentElevation);