~aleteoryx/muditaos

6d6d26ffb5e630b6c3a7210a74e4c0427bf76985 — Maciej Gibowicz 1 year, 9 months ago 5a70754
[BH-1944] Changing the rounding method for minutes in progress bar

Fix for rounding minutes in Focus Timer application
M module-apps/apps-common/widgets/TimeMinuteSecondWidget.cpp => module-apps/apps-common/widgets/TimeMinuteSecondWidget.cpp +12 -3
@@ 140,9 140,7 @@ namespace gui

    void TimeMinuteSecondWidget::updateTime(std::uint32_t seconds)
    {
        if (!totalSeconds.has_value()) {
            totalSeconds = seconds;
        }
        updateTotalSeconds(seconds);
        secondsLeft = seconds;
        if (displayType != DisplayType::OnlySeconds &&
            (seconds >= utils::time::secondsInMinute || displayType == DisplayType::OnlyMinutes)) {


@@ 182,4 180,15 @@ namespace gui
        }
        digitsContainer->resizeItems();
    }

    void TimeMinuteSecondWidget::updateTotalSeconds(std::uint32_t seconds)
    {
        if (seconds == 0) {
            totalSeconds.reset();
            return;
        }
        if (!totalSeconds.has_value()) {
            totalSeconds = seconds;
        }
    }
} /* namespace gui */

M module-apps/apps-common/widgets/TimeMinuteSecondWidget.hpp => module-apps/apps-common/widgets/TimeMinuteSecondWidget.hpp +2 -0
@@ 43,5 43,7 @@ namespace gui
        VBox *digitBox[maxDigits]{nullptr};
        Label *digitsText[maxDigits]{nullptr};
        Label *description{nullptr};

        void updateTotalSeconds(std::uint32_t seconds);
    };
} // namespace gui