From cdd6ac1d8bb64edde8905f48bb2c37e9eb011051 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Fri, 14 Apr 2023 00:23:57 +0200 Subject: [PATCH] Added Counter of Turns in Timer Stopwatch --- src/UserInterfaceManager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/UserInterfaceManager.cpp b/src/UserInterfaceManager.cpp index 10ecf34..4e72a9e 100644 --- a/src/UserInterfaceManager.cpp +++ b/src/UserInterfaceManager.cpp @@ -5065,10 +5065,17 @@ void TimerMetronome::Render() // small text: remaining time ImGui::PushStyleColor(ImGuiCol_Text, colorfg); ImGuiToolkit::PushFont(ImGuiToolkit::FONT_BOLD); - sprintf(text_buf, "%s", GstToolkit::time_to_string(duration_hand_-(time_-start_time_hand_)%duration_hand_, GstToolkit::TIME_STRING_READABLE).c_str() ); + + guint64 lap = (time_-start_time_hand_)/duration_hand_; + sprintf(text_buf, "%ld turn%s", lap, lap > 1 ? "s" : " " ); label_size = ImGui::CalcTextSize(text_buf, NULL); ImGui::SetCursorScreenPos(circle_center + ImVec2(0.f, circle_radius * -0.7f) - label_size/2); ImGui::Text("%s", text_buf); + + sprintf(text_buf, "%s", GstToolkit::time_to_string(duration_hand_-(time_-start_time_hand_)%duration_hand_, GstToolkit::TIME_STRING_READABLE).c_str() ); + label_size = ImGui::CalcTextSize(text_buf, NULL); + ImGui::SetCursorScreenPos(circle_center - ImVec2(0.f, circle_radius * -0.7f) - label_size/2); + ImGui::Text("%s", text_buf); ImGui::PopFont(); ImGui::PopStyleColor();