~aleteoryx/muditaos

6cd7e91800706916449852545881f1356bc8fedd — Lefucjusz 2 years ago cc0fcea
[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.
1 files changed, 6 insertions(+), 0 deletions(-)

M module-gui/gui/widgets/ProgressBar.cpp
M module-gui/gui/widgets/ProgressBar.cpp => module-gui/gui/widgets/ProgressBar.cpp +6 -0
@@ 245,6 245,7 @@ namespace gui
        const auto absoluteValue = std::lround(static_cast<float>(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);
    }