From 9ff36a172234fcc90d334649393a573afb8e200f Mon Sep 17 00:00:00 2001 From: Mateusz Grzegorzek Date: Mon, 6 Sep 2021 16:03:16 +0200 Subject: [PATCH] [BH-835] Add Alarm Settings menu window Add alarm settings options in `BellSettingsAlarmSettingsWindow` --- image/assets/lang/English.json | 3 ++ .../data/BellSettingsStyle.hpp | 6 +++ .../ApplicationBellSettings.hpp | 23 ++++++---- .../BellSettingsAlarmSettingsWindow.cpp | 46 ++++++++++++++++++- .../BellSettingsAlarmSettingsWindow.hpp | 4 ++ 5 files changed, 70 insertions(+), 12 deletions(-) diff --git a/image/assets/lang/English.json b/image/assets/lang/English.json index d62145a189e11f085fad9cd07cdf4f5487e24265..0e2be41612470be5091a85a4866f574525f69c54 100644 --- a/image/assets/lang/English.json +++ b/image/assets/lang/English.json @@ -571,6 +571,9 @@ "app_bell_settings_advanced_time_units": "Time & units", "app_bell_settings_advanced_temp_scale": "Temperature scale", "app_bell_settings_alarm_settings": "Alarm settings", + "app_bell_settings_alarm_settings_prewake_up": "Pre-wake up", + "app_bell_settings_alarm_settings_alarm_tone_and_light": "Alarm tone & light", + "app_bell_settings_alarm_settings_snooze": "Snooze", "app_bell_settings_bedtime_tone": "Bedtime tone", "app_bell_settings_home_view": "Home view", "app_bell_settings_turn_off": "Turn off", diff --git a/products/BellHybrid/apps/application-bell-settings/data/BellSettingsStyle.hpp b/products/BellHybrid/apps/application-bell-settings/data/BellSettingsStyle.hpp index 0242f64c27a78e05cb16ae5a2a06f6653defa75f..4aa2f5d97579af2e6f3da6672f37ae675c785297 100644 --- a/products/BellHybrid/apps/application-bell-settings/data/BellSettingsStyle.hpp +++ b/products/BellHybrid/apps/application-bell-settings/data/BellSettingsStyle.hpp @@ -26,5 +26,11 @@ namespace gui { inline constexpr auto font = "gt_pressura_light_46"; } + namespace alarm_settings_window + { + inline constexpr auto options_list_margin_x = 100U; + inline constexpr auto options_list_margin_y = 110U; + inline constexpr auto default_body_width = 400U; + } // namespace alarm_settings_window } // namespace bell_settings_style } // namespace gui diff --git a/products/BellHybrid/apps/application-bell-settings/include/application-bell-settings/ApplicationBellSettings.hpp b/products/BellHybrid/apps/application-bell-settings/include/application-bell-settings/ApplicationBellSettings.hpp index 0fc4ac473e0f997e9a8e5b2623370d837f8d72cd..8252a8ac31004c2cd79620e60327056e4ab6b06a 100644 --- a/products/BellHybrid/apps/application-bell-settings/include/application-bell-settings/ApplicationBellSettings.hpp +++ b/products/BellHybrid/apps/application-bell-settings/include/application-bell-settings/ApplicationBellSettings.hpp @@ -8,16 +8,19 @@ namespace gui::window::name { - inline constexpr auto bellSettings = "BellSettings"; - inline constexpr auto bellSettingsAdvanced = "BellSettingsAdvanced"; - inline constexpr auto bellSettingsTimeUnits = "BellSettingsTimeUnits"; - inline constexpr auto bellSettingsDialog = "BellSettingsDialog"; - inline constexpr auto bellSettingsFinished = "BellSettingsFinished"; - inline constexpr auto bellSettingsFrontlight = "BellSettingsFrontlight"; - inline constexpr auto bellSettingsHomeView = "BellSettingsHomeView"; - inline constexpr auto bellSettingsAlarmSettings = "BellSettingsAlarmSettings"; - inline constexpr auto bellSettingsBedtimeTone = "BellSettingsBedtimeTone"; - inline constexpr auto bellSettingsTurnOff = "BellSettingsTurnOff"; + inline constexpr auto bellSettings = "BellSettings"; + inline constexpr auto bellSettingsAdvanced = "BellSettingsAdvanced"; + inline constexpr auto bellSettingsTimeUnits = "BellSettingsTimeUnits"; + inline constexpr auto bellSettingsDialog = "BellSettingsDialog"; + inline constexpr auto bellSettingsFinished = "BellSettingsFinished"; + inline constexpr auto bellSettingsFrontlight = "BellSettingsFrontlight"; + inline constexpr auto bellSettingsHomeView = "BellSettingsHomeView"; + inline constexpr auto bellSettingsAlarmSettings = "BellSettingsAlarmSettings"; + inline constexpr auto bellSettingsAlarmSettingsPrewakeUp = "BellSettingsAlarmSettingsPrewakeUp"; + inline constexpr auto bellSettingsAlarmSettingsAlarmToneAndLight = "BellSettingsAlarmSettingsAlarmToneAndLight"; + inline constexpr auto bellSettingsAlarmSettingsSnooze = "BellSettingsAlarmSettingsSnooze"; + inline constexpr auto bellSettingsBedtimeTone = "BellSettingsBedtimeTone"; + inline constexpr auto bellSettingsTurnOff = "BellSettingsTurnOff"; } // namespace gui::window::name namespace app diff --git a/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsAlarmSettingsWindow.cpp b/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsAlarmSettingsWindow.cpp index db5647bb9642e01f123cfa4734dd228a5e6e7bd1..7936aea65f57dc4237638126c236958849b085dd 100644 --- a/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsAlarmSettingsWindow.cpp +++ b/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsAlarmSettingsWindow.cpp @@ -4,12 +4,16 @@ #include "BellSettingsAlarmSettingsWindow.hpp" #include +#include +#include +#include namespace gui { BellSettingsAlarmSettingsWindow::BellSettingsAlarmSettingsWindow(app::Application *app, std::string name) : OptionWindow(app, std::move(name)) { + addOptions(alarmSettingsOptionsList()); buildInterface(); } @@ -21,9 +25,47 @@ namespace gui void BellSettingsAlarmSettingsWindow::buildInterface() { - AppWindow::buildInterface(); + header->setTitle(title); + header->setEdges(RectangleEdge::None); statusBar->setVisible(false); - header->setTitleVisibility(false); bottomBar->setVisible(false); + + optionsList->setPosition(bell_settings_style::alarm_settings_window::options_list_margin_x, + bell_settings_style::alarm_settings_window::options_list_margin_y); + optionsList->setMaximumWidth(bell_settings_style::alarm_settings_window::default_body_width); + optionsList->setBoundaries(gui::Boundaries::Fixed); + } + + std::list