From 6cd7e91800706916449852545881f1356bc8fedd Mon Sep 17 00:00:00 2001 From: Lefucjusz Date: Tue, 12 Dec 2023 16:42:53 +0100 Subject: [PATCH] [BH-1826] Fix corner case for new progress bar design Fix minor corner case so that current progress bar implementation fully matches the design - after the bar has decremented to zero, there should be no start or end indicator visible. --- module-gui/gui/widgets/ProgressBar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module-gui/gui/widgets/ProgressBar.cpp b/module-gui/gui/widgets/ProgressBar.cpp index c78d7f9a92c20ede5abd14f7ea91c99ff53097de..e98e21776b58335564b809f3883d19611519f435 100644 --- a/module-gui/gui/widgets/ProgressBar.cpp +++ b/module-gui/gui/widgets/ProgressBar.cpp @@ -245,6 +245,7 @@ namespace gui const auto absoluteValue = std::lround(static_cast(maxValue) * percent); setValue(absoluteValue); } + int ArcProgressBar::getMaximum() const noexcept { return maxValue; @@ -272,6 +273,11 @@ namespace gui progressStartIndicator->setCenter(calculateStartIndicatorCenter()); progressEndIndicator->setCenter(calculateEndIndicatorCenter()); + const auto progressItemsVisible = ((dTheta != 0) || (change == ProgressChange::IncrementFromZero)); + progressArc->setVisible(progressItemsVisible); + progressStartIndicator->setVisible(progressItemsVisible); + progressEndIndicator->setVisible(progressItemsVisible); + Arc::buildDrawListImplementation(commands); }