From b1648fb53a225b3ecf0712d035bceaedb68c6e3a Mon Sep 17 00:00:00 2001 From: Maciej Gibowicz Date: Tue, 2 Jul 2024 12:57:56 +0200 Subject: [PATCH] [BH-2013] Add label with the name of the application on the countdown screens Harmony's UI will be consistent so that on each screen showing the elapsed time on a timer (Meditation, Relaxation and Focus Timer, Power nap) will have words indicating which feature is active. This is how it is done with the focus timer and has been added to other timers as well. --- harmony_changelog.md | 1 + .../data/MeditationStyle.hpp | 58 +++++++++++-------- .../windows/MeditationRunningWindow.cpp | 13 +++++ .../windows/MeditationRunningWindow.hpp | 1 + .../data/PowerNapStyle.hpp | 40 ++++++++----- .../windows/PowerNapProgressWindow.cpp | 13 +++++ .../windows/PowerNapProgressWindow.hpp | 1 + .../data/RelaxationStyle.hpp | 12 +++- .../RelaxationRunningProgressWindow.cpp | 12 ++++ .../RelaxationRunningProgressWindow.hpp | 1 + 10 files changed, 109 insertions(+), 43 deletions(-) diff --git a/harmony_changelog.md b/harmony_changelog.md index b47aafab904bfea291d23024a2af3eb881bf5881..cfe35f82c35cc41a15b210d1fab8b363549b005a 100644 --- a/harmony_changelog.md +++ b/harmony_changelog.md @@ -10,6 +10,7 @@ * Added update instruction screen at end of onboarding * Added update instruction screen in Settings * Added volume setting for focus timer application +* Added label with the name of the application on the countdown screens ### Changed / Improved * Changed the refresh rate of the progress bar screen diff --git a/products/BellHybrid/apps/application-bell-meditation-timer/data/MeditationStyle.hpp b/products/BellHybrid/apps/application-bell-meditation-timer/data/MeditationStyle.hpp index 234767fe710f18997e741c41372476e6c02b2486..b541a41f44e2a2bed1c65740034611b9aaa67523 100644 --- a/products/BellHybrid/apps/application-bell-meditation-timer/data/MeditationStyle.hpp +++ b/products/BellHybrid/apps/application-bell-meditation-timer/data/MeditationStyle.hpp @@ -11,56 +11,64 @@ namespace app::meditationStyle { namespace progress { - constexpr inline auto radius = 192; - constexpr inline auto penWidth = 3; - constexpr inline auto verticalDeviationDegrees = 38; + inline constexpr auto radius = 192U; + inline constexpr auto penWidth = 3U; + inline constexpr auto verticalDeviationDegrees = 38U; } // namespace progress namespace timer { - constexpr inline auto marginTop = 39; - constexpr inline auto maxSizeX = 340; - constexpr inline auto maxSizeY = 198; + inline constexpr auto marginTop = 19U; + inline constexpr auto maxSizeX = 340U; + inline constexpr auto maxSizeY = 198U; } // namespace timer namespace pauseIcon { - constexpr inline auto image = "big_pause"; - constexpr inline auto marginTop = 39; - constexpr inline auto maxSizeX = 203; - constexpr inline auto maxSizeY = 203; + inline constexpr auto image = "big_pause"; + inline constexpr auto maxSizeX = 203U; + inline constexpr auto maxSizeY = 203U; + inline constexpr auto marginTop = timer::marginTop - (maxSizeY - timer::maxSizeY); } // namespace pauseIcon namespace clock { - constexpr inline auto marginTop = 17; - constexpr inline auto maxSizeX = 340; - constexpr inline auto maxSizeY = 84; + inline constexpr auto marginTop = 17U; + inline constexpr auto maxSizeX = 340U; + inline constexpr auto maxSizeY = 84U; } // namespace clock + + namespace bottomDescription + { + inline constexpr auto marginTop = 38U; + inline constexpr auto maxSizeX = 340U; + inline constexpr auto maxSizeY = 80U; + inline constexpr auto font = style::window::font::verybig; + } // namespace bottomDescription } // namespace runningStyle namespace countdownStyle { namespace progress { - constexpr inline auto radius = runningStyle::progress::radius; - constexpr inline auto penWidth = 9; - constexpr inline auto verticalDeviationDegrees = runningStyle::progress::verticalDeviationDegrees; + inline constexpr auto radius = runningStyle::progress::radius; + inline constexpr auto penWidth = 9U; + inline constexpr auto verticalDeviationDegrees = runningStyle::progress::verticalDeviationDegrees; } // namespace progress namespace timer { - constexpr inline auto marginTop = 24; - constexpr inline auto maxSizeX = runningStyle::timer::maxSizeX; - constexpr inline auto maxSizeY = runningStyle::timer::maxSizeY; + inline constexpr auto marginTop = 24U; + inline constexpr auto maxSizeX = runningStyle::timer::maxSizeX; + inline constexpr auto maxSizeY = runningStyle::timer::maxSizeY; } // namespace timer namespace description { - constexpr inline auto font = style::window::font::large; - constexpr inline auto marginTop = 63; - constexpr inline auto maxSizeX = 380; - constexpr inline auto maxSizeY = 102; + inline constexpr auto font = style::window::font::large; + inline constexpr auto marginTop = 63U; + inline constexpr auto maxSizeX = 380U; + inline constexpr auto maxSizeY = 102U; } // namespace description } // namespace countdownStyle @@ -68,12 +76,12 @@ namespace app::meditationStyle { namespace text { - constexpr inline auto font = style::window::font::supersizemelight; + inline constexpr auto font = style::window::font::supersizemelight; } namespace minute { - constexpr inline auto font = style::window::font::largelight; + inline constexpr auto font = style::window::font::largelight; } } // namespace timerStyle } // namespace app::meditationStyle diff --git a/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.cpp b/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.cpp index 9ba22a6c32e4061b019a3f1d08959738552a2033..4c257abd788700fb2c5c16348debac5e084b5f54 100644 --- a/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.cpp +++ b/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.cpp @@ -90,6 +90,19 @@ namespace gui icon->image->set(runningStyle::pauseIcon::image, ImageTypeSpecifier::W_G); icon->setVisible(false); + bottomDescription = new gui::TextFixedSize( + mainVBox, 0, 0, runningStyle::bottomDescription::maxSizeX, runningStyle::bottomDescription::maxSizeY); + bottomDescription->setMaximumSize(runningStyle::bottomDescription::maxSizeX, + runningStyle::bottomDescription::maxSizeY); + bottomDescription->setFont(runningStyle::bottomDescription::font); + bottomDescription->setMargins(gui::Margins(0, 0, 0, 0)); + bottomDescription->activeItem = false; + bottomDescription->setAlignment( + gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Top)); + bottomDescription->setRichText(utils::translate("app_bellmain_meditation_timer")); + bottomDescription->drawUnderline(false); + bottomDescription->setVisible(true); + mainVBox->resizeItems(); } diff --git a/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.hpp b/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.hpp index ae139348b56221930e821bbac1b8570f1d186ceb..c11f63d7d2facf3d56e20dacd66fab0db8792aa8 100644 --- a/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.hpp +++ b/products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.hpp @@ -36,6 +36,7 @@ namespace gui VBox *mainVBox{nullptr}; ArcProgressBar *progress{nullptr}; TimeMinuteSecondWidget *timer{nullptr}; + gui::TextFixedSize *bottomDescription{nullptr}; Icon *icon{nullptr}; gui::BellStatusClock *clock{nullptr}; diff --git a/products/BellHybrid/apps/application-bell-powernap/data/PowerNapStyle.hpp b/products/BellHybrid/apps/application-bell-powernap/data/PowerNapStyle.hpp index 4f09fc8d0594f8466a28ec2e0e20da2fb8d49ac3..b4fc92d1efce78d4ce9a310ad49089d71b0dc24b 100644 --- a/products/BellHybrid/apps/application-bell-powernap/data/PowerNapStyle.hpp +++ b/products/BellHybrid/apps/application-bell-powernap/data/PowerNapStyle.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #pragma once @@ -13,40 +13,48 @@ namespace gui::powerNapStyle { namespace progress { - inline constexpr auto radius = 192; - inline constexpr auto penWidth = 3; - inline constexpr auto verticalDeviationDegrees = 38; + inline constexpr auto radius = 192U; + inline constexpr auto penWidth = 3U; + inline constexpr auto verticalDeviationDegrees = 38U; } // namespace progress namespace timer { - inline constexpr auto marginTop = 41; + inline constexpr auto marginTop = 19U; inline constexpr auto font = style::window::font::supersizeme; - inline constexpr auto maxSizeX = 340; - inline constexpr auto maxSizeY = 198; + inline constexpr auto maxSizeX = 340U; + inline constexpr auto maxSizeY = 198U; } // namespace timer namespace pauseIcon { inline constexpr auto image = "big_pause"; - inline constexpr auto marginTop = 39; - inline constexpr auto maxSizeX = 203; - inline constexpr auto maxSizeY = 203; + inline constexpr auto maxSizeX = 203U; + inline constexpr auto maxSizeY = 203U; + inline constexpr auto marginTop = timer::marginTop - (maxSizeY - timer::maxSizeY); } // namespace pauseIcon namespace ringIcon { inline constexpr auto image = "big_bell_ringing"; - inline constexpr auto marginTop = 39; - inline constexpr auto maxSizeX = 210; - inline constexpr auto maxSizeY = 203; + inline constexpr auto maxSizeX = 210U; + inline constexpr auto maxSizeY = 203U; + inline constexpr auto marginTop = timer::marginTop - (maxSizeY - timer::maxSizeY); } // namespace ringIcon namespace clock { - inline constexpr auto marginTop = 17; - inline constexpr auto maxSizeX = 340; - inline constexpr auto maxSizeY = 84; + inline constexpr auto marginTop = 17U; + inline constexpr auto maxSizeX = 340U; + inline constexpr auto maxSizeY = 84U; } // namespace clock + + namespace bottomDescription + { + inline constexpr auto marginTop = 38U; + inline constexpr auto maxSizeX = 340U; + inline constexpr auto maxSizeY = 80U; + inline constexpr auto font = style::window::font::verybig; + } // namespace bottomDescription } } // namespace gui::powerNapStyle diff --git a/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp b/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp index 6e555d428efcfd74042301bac97a22c52628787c..e0eece6a9d1ac07fd0c2c1e0cd6ffd119f27564c 100644 --- a/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp +++ b/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp @@ -91,6 +91,19 @@ namespace gui iconRing->image->set(progressStyle::ringIcon::image, ImageTypeSpecifier::W_G); iconRing->setVisible(false); + bottomDescription = new gui::TextFixedSize( + mainVBox, 0, 0, progressStyle::bottomDescription::maxSizeX, progressStyle::bottomDescription::maxSizeY); + bottomDescription->setMaximumSize(progressStyle::bottomDescription::maxSizeX, + progressStyle::bottomDescription::maxSizeY); + bottomDescription->setFont(progressStyle::bottomDescription::font); + bottomDescription->setMargins(gui::Margins(0, 0, 0, 0)); + bottomDescription->activeItem = false; + bottomDescription->setAlignment( + gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Top)); + bottomDescription->setRichText(utils::translate("app_bellmain_power_nap")); + bottomDescription->drawUnderline(false); + bottomDescription->setVisible(true); + mainVBox->resizeItems(); } diff --git a/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.hpp b/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.hpp index 6f6be7c7ab75136d2c0c77ff29ba8e7d494e4e72..7335c42c8b169264f158e970a4dd4c4b7324e196 100644 --- a/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.hpp +++ b/products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.hpp @@ -35,6 +35,7 @@ namespace gui VBox *mainVBox{nullptr}; ArcProgressBar *progress{nullptr}; TimeMinuteSecondWidget *timer{nullptr}; + gui::TextFixedSize *bottomDescription{nullptr}; BellStatusClock *clock{nullptr}; Icon *iconPause{nullptr}; Icon *iconRing{nullptr}; diff --git a/products/BellHybrid/apps/application-bell-relaxation/data/RelaxationStyle.hpp b/products/BellHybrid/apps/application-bell-relaxation/data/RelaxationStyle.hpp index f85f014df0f40cee34c090c4c3ff67902ca432a9..cea0b59a12db9e79e4fb313f027e2d25059604f5 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/data/RelaxationStyle.hpp +++ b/products/BellHybrid/apps/application-bell-relaxation/data/RelaxationStyle.hpp @@ -49,7 +49,7 @@ namespace gui::relaxationStyle namespace timer { - inline constexpr auto marginTop = 41U; + inline constexpr auto marginTop = 19U; inline constexpr auto font = style::window::font::supersizeme; inline constexpr auto maxSizeX = 340U; inline constexpr auto maxSizeY = 198U; @@ -58,9 +58,9 @@ namespace gui::relaxationStyle namespace pauseIcon { inline constexpr auto image = "big_pause"; - inline constexpr auto marginTop = 39U; inline constexpr auto maxSizeX = 203U; inline constexpr auto maxSizeY = 203U; + inline constexpr auto marginTop = timer::marginTop - (maxSizeY - timer::maxSizeY); } // namespace pauseIcon namespace clock @@ -69,5 +69,13 @@ namespace gui::relaxationStyle inline constexpr auto maxSizeX = 340U; inline constexpr auto maxSizeY = 84U; } // namespace clock + + namespace bottomDescription + { + inline constexpr auto marginTop = 38U; + inline constexpr auto maxSizeX = 340U; + inline constexpr auto maxSizeY = 80U; + inline constexpr auto font = style::window::font::verybig; + } // namespace bottomDescription } // namespace relStyle } // namespace gui::relaxationStyle diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp index a08577c405609cc6b2de35e9f0edfb1fcb07a9b7..64803a0e4d29626063f563743fc0b072805a7a22 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp @@ -87,6 +87,18 @@ namespace gui icon->image->set(relStyle::pauseIcon::image, ImageTypeSpecifier::W_G); icon->setVisible(false); + bottomDescription = new gui::TextFixedSize( + mainVBox, 0, 0, relStyle::bottomDescription::maxSizeX, relStyle::bottomDescription::maxSizeY); + bottomDescription->setMaximumSize(relStyle::bottomDescription::maxSizeX, relStyle::bottomDescription::maxSizeY); + bottomDescription->setFont(relStyle::bottomDescription::font); + bottomDescription->setMargins(gui::Margins(0, 0, 0, 0)); + bottomDescription->activeItem = false; + bottomDescription->setAlignment( + gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Top)); + bottomDescription->setRichText(utils::translate("app_bellmain_relaxation")); + bottomDescription->drawUnderline(false); + bottomDescription->setVisible(true); + mainVBox->resizeItems(); } diff --git a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.hpp b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.hpp index d1a233cb8122754a54a98086c608077131915351..3148385cc90ec5d8b0c4da3bd712984932e287dc 100644 --- a/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.hpp +++ b/products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.hpp @@ -29,6 +29,7 @@ namespace gui VBox *mainVBox{nullptr}; ArcProgressBar *progress{nullptr}; TimeMinuteSecondWidget *timer{nullptr}; + gui::TextFixedSize *bottomDescription{nullptr}; Icon *icon{nullptr}; BellStatusClock *clock{nullptr};