From 1e4c7932cd28f4e27cd93433376824272dbe17a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jo=C5=84ski?= Date: Thu, 24 Mar 2022 12:47:52 +0100 Subject: [PATCH] [BH-1411] Layouts settings arrows adjustment Layouts settings arrows adjustment --- module-gui/gui/widgets/Style.hpp | 1 + products/BellHybrid/CMakeLists.txt | 4 ++-- .../windows/BellSettingsLayoutWindow.cpp | 12 +++++++----- .../common/include/common/widgets/LayoutVertical.hpp | 4 +++- .../common/widgets/TimeSetSpinnerVertical.hpp | 4 +++- .../src/layouts/HomeScreenLayoutVerticalWithAmPm.cpp | 3 ++- .../apps/common/src/widgets/LayoutVertical.cpp | 4 +++- products/BellHybrid/assets/assets_community.json | 5 +++++ products/BellHybrid/assets/assets_proprietary.json | 5 +++++ 9 files changed, 31 insertions(+), 11 deletions(-) diff --git a/module-gui/gui/widgets/Style.hpp b/module-gui/gui/widgets/Style.hpp index a3ed3404ac414ce26e33ea0192e945a495158e25..ee1d382875c983a882644223d6fa6333a2ca2644 100644 --- a/module-gui/gui/widgets/Style.hpp +++ b/module-gui/gui/widgets/Style.hpp @@ -58,6 +58,7 @@ namespace style inline constexpr auto default_rect_yaps = 10U; namespace font { + inline constexpr auto colossal = "colossal"; inline constexpr auto huge = "huge"; inline constexpr auto supersizeme = "supersizeme"; inline constexpr auto supersizemelight = "supersizemelight"; diff --git a/products/BellHybrid/CMakeLists.txt b/products/BellHybrid/CMakeLists.txt index cf9c8bba0b3bd2ec607ada499f2fc27bac7a1f5e..afdfc2d3233eb7b0c789ec40eb668c899d75404d 100644 --- a/products/BellHybrid/CMakeLists.txt +++ b/products/BellHybrid/CMakeLists.txt @@ -108,14 +108,14 @@ download_asset_release_json(json-common-target ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_common.json ${CMAKE_BINARY_DIR}/sysroot/sys/current/ MuditaOSPublicAssets - 0.0.7 + 0.0.8 ${MUDITA_CACHE_DIR} ) download_asset_release_json(json-community-target ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_community.json ${CMAKE_BINARY_DIR}/sysroot/sys/current/ MuditaOSPublicAssets - 0.0.7 + 0.0.8 ${MUDITA_CACHE_DIR} ) download_asset_json(json-rt1051-target diff --git a/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsLayoutWindow.cpp b/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsLayoutWindow.cpp index b61c91e3a97ee6e7dbfe192a88aaf5ea7fe35cc8..320847a81c79094073676cada1d7b020a3c8ccf7 100644 --- a/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsLayoutWindow.cpp +++ b/products/BellHybrid/apps/application-bell-settings/windows/BellSettingsLayoutWindow.cpp @@ -8,8 +8,7 @@ namespace { - inline constexpr auto arrowsWidth = 580U; - inline constexpr auto arrowsLeftMargin = 10U; + inline constexpr auto arrowsOuterMargin = 48U; } // namespace namespace gui @@ -40,7 +39,7 @@ namespace gui auto selectedLayout = presenter->getSelectedLayout(); spinner->setCurrentValue(selectedLayout); - createArrowsOverlay(0, 0, arrowsWidth, style::window_height); + createArrowsOverlay(0, 0, style::window_width, style::window_height); arrowLeft->setVisible(!spinner->isAtMin()); arrowRight->setVisible(!spinner->isAtMax()); @@ -53,23 +52,26 @@ namespace gui void BellSettingsLayoutWindow::createArrowsOverlay(unsigned int x, unsigned y, unsigned int w, unsigned int h) { - auto arrowsOverlay = new HBox{this, arrowsLeftMargin, y, w, h}; + auto arrowsOverlay = new HBox{this, x, y, w, h}; arrowsOverlay->setEdges(gui::RectangleEdge::None); arrowLeft = new Image("bell_arrow_left_W_M"); arrowLeft->setAlignment(Alignment(gui::Alignment::Horizontal::Left, gui::Alignment::Vertical::Center)); arrowLeft->activeItem = false; arrowLeft->setEdges(RectangleEdge::None); + arrowLeft->setMargins(Margins{arrowsOuterMargin, 0, 0, 0}); arrowsOverlay->addWidget(arrowLeft); arrowRight = new Image("bell_arrow_right_W_M"); arrowRight->setAlignment(Alignment(Alignment::Horizontal::Right, Alignment::Vertical::Center)); arrowRight->activeItem = false; arrowRight->setEdges(RectangleEdge::None); + arrowRight->setMargins(Margins{0, 0, arrowsOuterMargin, 0}); auto rectFiller = new gui::Rect(arrowsOverlay, 0U, 0U, - arrowsOverlay->getWidth() - arrowLeft->getWidth() - arrowRight->getWidth(), + arrowsOverlay->getWidth() - arrowLeft->getWidth() - arrowRight->getWidth() - + (2 * arrowsOuterMargin), arrowsOverlay->getHeight()); rectFiller->setMaximumSize(arrowsOverlay->getWidth(), arrowsOverlay->getHeight()); diff --git a/products/BellHybrid/apps/common/include/common/widgets/LayoutVertical.hpp b/products/BellHybrid/apps/common/include/common/widgets/LayoutVertical.hpp index 4211f5b7fabdae478521f40811f882c4bdc78ea5..af4628ba57dc6b2dc4ed2e59738f00e0ce90cfce 100644 --- a/products/BellHybrid/apps/common/include/common/widgets/LayoutVertical.hpp +++ b/products/BellHybrid/apps/common/include/common/widgets/LayoutVertical.hpp @@ -9,8 +9,10 @@ namespace style::homescreen_vertical { - constexpr inline auto side_box_w = 180U; + constexpr inline auto side_box_w = 120U; constexpr inline auto center_box_w = 240U; + constexpr inline auto leftMargin = 60U; + constexpr inline auto rightMargin = 60U; } // namespace style::homescreen_vertical namespace gui diff --git a/products/BellHybrid/apps/common/include/common/widgets/TimeSetSpinnerVertical.hpp b/products/BellHybrid/apps/common/include/common/widgets/TimeSetSpinnerVertical.hpp index f85035ae9dd6313cb18b129b2a804296769ff46e..37a6a00df3b1d6511c5bc8dc0a7cd3d27b43154c 100644 --- a/products/BellHybrid/apps/common/include/common/widgets/TimeSetSpinnerVertical.hpp +++ b/products/BellHybrid/apps/common/include/common/widgets/TimeSetSpinnerVertical.hpp @@ -19,6 +19,7 @@ namespace style::time_set_spinner_vertical inline constexpr auto small_margin = 6U; inline constexpr auto big_margin = 44U; + inline constexpr auto colossal_margin = -40; } // namespace style::time_set_spinner_vertical namespace gui @@ -64,7 +65,8 @@ namespace gui {style::window::font::verybiglight, {0, 0, 0, style::time_set_spinner_vertical::small_margin}}, {style::window::font::largelight, {0, 0, 0, style::time_set_spinner_vertical::small_margin}}, {style::window::font::supersizemelight, {0, 0, 0, style::time_set_spinner_vertical::big_margin}}, - {style::window::font::huge, {0, 0, 0, style::time_set_spinner_vertical::big_margin}}}; + {style::window::font::huge, {0, 0, 0, style::time_set_spinner_vertical::big_margin}}, + {style::window::font::colossal, {0, 0, 0, style::time_set_spinner_vertical::colossal_margin}}}; void handleContentChanged() override; diff --git a/products/BellHybrid/apps/common/src/layouts/HomeScreenLayoutVerticalWithAmPm.cpp b/products/BellHybrid/apps/common/src/layouts/HomeScreenLayoutVerticalWithAmPm.cpp index cdffc2acd9e17f8df7c62c424ee24dde6f776c26..8c8df1a922a414e6e25e386c249f6a89b782aea4 100644 --- a/products/BellHybrid/apps/common/src/layouts/HomeScreenLayoutVerticalWithAmPm.cpp +++ b/products/BellHybrid/apps/common/src/layouts/HomeScreenLayoutVerticalWithAmPm.cpp @@ -37,6 +37,7 @@ namespace gui leftTopBox->addWidget(alarmMainIcon); leftTopBox->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Top)); alarmMainIcon->setMargins(Margins{0, style::homescreen_vertical_ampm::alarm_margin_top, 0, 0}); + alarmMainIcon->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Top)); leftBottomBox->addWidget(battery); leftBottomBox->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Bottom)); @@ -45,7 +46,7 @@ namespace gui rightBox->setAlignment(Alignment(Alignment::Horizontal::Right, Alignment::Vertical::Bottom)); fmt = new TextFixedSize(rightBox, 0, 0, 0, 0); fmt->setMaximumSize(style::bell_base_layout::outer_layouts_w, style::bell_base_layout::outer_layouts_h); - fmt->setFont(mainWindow::bottomDescription::font_small); + fmt->setFont(mainWindow::bottomDescription::font_normal); fmt->setEdges(RectangleEdge::None); fmt->activeItem = false; fmt->drawUnderline(false); diff --git a/products/BellHybrid/apps/common/src/widgets/LayoutVertical.cpp b/products/BellHybrid/apps/common/src/widgets/LayoutVertical.cpp index 59be9cd2cc3b335dd303a3f33ba00d78e75262ca..9548cce5100f10dd922fe70b094ff1bbf7e16223 100644 --- a/products/BellHybrid/apps/common/src/widgets/LayoutVertical.cpp +++ b/products/BellHybrid/apps/common/src/widgets/LayoutVertical.cpp @@ -33,13 +33,14 @@ namespace gui leftBox = new VBox(mainScreen, 0, 0, 0, 0); leftBox->setMinimumSize(style::homescreen_vertical::side_box_w, style::window_height); leftBox->setEdges(RectangleEdge::None); + leftBox->setMargins(Margins({style::homescreen_vertical::leftMargin, 0, 0, 0})); auto centerBox = new VBox(mainScreen, 0, 0, 0, 0); centerBox->setMinimumSize(style::homescreen_vertical::center_box_w, style::window_height); centerBox->setEdges(RectangleEdge::None); time = new TimeSetSpinnerVertical(centerBox); - time->setFont(mainWindow::time::font); + time->setFont(style::window::font::colossal); time->setMinimumSize(style::homescreen_vertical::center_box_w, style::window_height); time->setEdges(RectangleEdge::None); time->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Center)); @@ -47,6 +48,7 @@ namespace gui rightBox = new VBox(mainScreen, 0, 0, 0, 0); rightBox->setMinimumSize(style::homescreen_vertical::side_box_w, style::window_height); rightBox->setEdges(RectangleEdge::None); + rightBox->setMargins(Margins({0, 0, style::homescreen_vertical::rightMargin, 0})); alarmMainIcon = new AlarmIcon(nullptr); alarmMainIcon->setMinimumSize(style::bell_base_layout::outer_layouts_w, diff --git a/products/BellHybrid/assets/assets_community.json b/products/BellHybrid/assets/assets_community.json index 8a869a1529f10bca4381d4210b4aa86e0337af33..bd9c2cba99df2bbd4bed600ffb2c7916590cce54 100644 --- a/products/BellHybrid/assets/assets_community.json +++ b/products/BellHybrid/assets/assets_community.json @@ -10,6 +10,11 @@ "tarfile": "image/assets/fonts/dejavu_sans/dejavu_sans_regular_140.mpf", "output": "assets/fonts/dejavu_sans/dejavu_sans_regular_140.mpf" }, + { + "name": "release.tgz", + "tarfile": "image/assets/fonts/dejavu_sans/dejavu_sans_light_200.mpf", + "output": "assets/fonts/dejavu_sans/dejavu_sans_light_200.mpf" + }, { "name": "release.tgz", "tarfile": "image/assets/fonts/dejavu_sans/dejavu_sans_regular_90.mpf", diff --git a/products/BellHybrid/assets/assets_proprietary.json b/products/BellHybrid/assets/assets_proprietary.json index 3341ced29c207dd7669e356c674875d6d3a03d74..4bcb1f140e88fa562b5d853c070928a1685db632 100644 --- a/products/BellHybrid/assets/assets_proprietary.json +++ b/products/BellHybrid/assets/assets_proprietary.json @@ -29,6 +29,11 @@ "ref": "10c74fcb09c2022325767cad735c0183b6f5393a", "output": "assets/fonts/gt_pressura/gt_pressura_regular_190.mpf" }, + { + "name": "./fonts/bell/gt_pressura_light_200.mpf", + "ref": "6e0731ffcc08a682010bb7724a5e1f230a273e2a", + "output": "assets/fonts/gt_pressura/gt_pressura_light_200.mpf" + }, { "name": "./fonts/common/gt_pressura_light_30.mpf", "ref": "10c74fcb09c2022325767cad735c0183b6f5393a",