Fixing intermittent elevation button resize issue

This commit is contained in:
Dan Paulat 2021-11-27 10:27:34 -06:00
parent b2e75f3c1f
commit 8b515dd3d2

View file

@ -56,6 +56,7 @@ public:
std::vector<map::MapWidget*> maps_; std::vector<map::MapWidget*> maps_;
std::vector<float> elevationCuts_; std::vector<float> elevationCuts_;
bool elevationButtonsChanged_;
bool resizeElevationButtons_; bool resizeElevationButtons_;
public slots: public slots:
@ -123,7 +124,11 @@ bool MainWindow::event(QEvent* event)
{ {
if (event->type() == QEvent::Type::Paint) 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 // Set each elevation cut's tool button to the same size
int elevationCutMaxWidth = 0; int elevationCutMaxWidth = 0;
@ -367,8 +372,9 @@ void MainWindowImpl::UpdateRadarProductSettings()
}); });
} }
elevationCuts_ = elevationCuts; elevationCuts_ = elevationCuts;
resizeElevationButtons_ = true; elevationButtonsChanged_ = true;
resizeElevationButtons_ = true;
} }
UpdateElevationSelection(currentElevation); UpdateElevationSelection(currentElevation);