From d353e444032d89cc70aebce9b81f7d19db6549f7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Brudny Date: Fri, 18 Jun 2021 14:11:50 +0200 Subject: [PATCH] [EGD-6950] Added header layout Added Header Layout. --- art/phone/common/arrow_left_24px_W_G.png | Bin 0 -> 310 bytes art/phone/common/arrow_right_24px_W_G.png | Bin 0 -> 293 bytes art/phone/common/plus_32px_W_G.png | Bin 0 -> 339 bytes art/phone/common/search_32px_W_G.png | Bin 0 -> 795 bytes image/assets/images/arrow_left_24px_W_G.vpi | Bin 0 -> 401 bytes image/assets/images/arrow_right_24px_W_G.vpi | Bin 0 -> 401 bytes image/assets/images/plus_32px_W_G.vpi | Bin 0 -> 597 bytes image/assets/images/search_32px_W_G.vpi | Bin 0 -> 893 bytes .../windows/BellMainMenuWindow.cpp | 5 +- .../windows/MeditationTimerWindow.cpp | 2 +- .../ConfigurationSuccessfulDialogWindow.cpp | 5 +- .../windows/NoConfigurationDialogWindow.cpp | 5 +- .../windows/OnBoardingDateAndTimeWindow.cpp | 4 +- .../windows/OnBoardingLanguagesWindow.cpp | 4 +- .../windows/OnBoardingSimSelectWindow.cpp | 6 +- .../windows/StartConfigurationWindow.cpp | 4 +- .../windows/PhonebookContactDetails.cpp | 4 +- module-apps/apps-common/CMakeLists.txt | 1 - .../locks/windows/LockInputWindow.cpp | 22 ++- .../locks/windows/LockInputWindow.hpp | 2 - module-apps/apps-common/widgets/IceBox.hpp | 32 ---- module-apps/apps-common/windows/AppWindow.cpp | 40 ++--- module-apps/apps-common/windows/AppWindow.hpp | 19 ++- module-apps/apps-common/windows/NoEvents.cpp | 8 +- module-gui/WINDOW.md | 4 +- module-gui/gui/widgets/CMakeLists.txt | 8 + .../gui/widgets/header/AddElementAction.cpp | 30 ++++ .../gui/widgets/header/AddElementAction.hpp | 15 ++ module-gui/gui/widgets/header/Header.cpp | 157 ++++++++++++++++++ module-gui/gui/widgets/header/Header.hpp | 45 +++++ .../gui/widgets/header/IceAction.cpp | 22 ++- module-gui/gui/widgets/header/IceAction.hpp | 15 ++ .../gui/widgets/header/SearchAction.cpp | 31 ++++ .../gui/widgets/header/SearchAction.hpp | 15 ++ module-gui/gui/widgets/header/Style.hpp | 26 +++ 35 files changed, 423 insertions(+), 108 deletions(-) create mode 100644 art/phone/common/arrow_left_24px_W_G.png create mode 100644 art/phone/common/arrow_right_24px_W_G.png create mode 100644 art/phone/common/plus_32px_W_G.png create mode 100644 art/phone/common/search_32px_W_G.png create mode 100644 image/assets/images/arrow_left_24px_W_G.vpi create mode 100644 image/assets/images/arrow_right_24px_W_G.vpi create mode 100644 image/assets/images/plus_32px_W_G.vpi create mode 100644 image/assets/images/search_32px_W_G.vpi delete mode 100644 module-apps/apps-common/widgets/IceBox.hpp create mode 100644 module-gui/gui/widgets/header/AddElementAction.cpp create mode 100644 module-gui/gui/widgets/header/AddElementAction.hpp create mode 100644 module-gui/gui/widgets/header/Header.cpp create mode 100644 module-gui/gui/widgets/header/Header.hpp rename module-apps/apps-common/widgets/IceBox.cpp => module-gui/gui/widgets/header/IceAction.cpp (51%) create mode 100644 module-gui/gui/widgets/header/IceAction.hpp create mode 100644 module-gui/gui/widgets/header/SearchAction.cpp create mode 100644 module-gui/gui/widgets/header/SearchAction.hpp create mode 100644 module-gui/gui/widgets/header/Style.hpp diff --git a/art/phone/common/arrow_left_24px_W_G.png b/art/phone/common/arrow_left_24px_W_G.png new file mode 100644 index 0000000000000000000000000000000000000000..95b9089818fa5d6b4c3b4f347a22aa6a0bb3d410 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#)1EGlAr*{orzrBZ7znt|RuX79v_RlaQvr(w z`y}lGRvn@4ClV?#4E;y0n)v=Q7xgt$*>GT6+Vu3|AMW4sz677F>8+5o&ZDLtk;$NqKz|#G)2}jcd zj~aag9_C3ZmdbWK7xuE>|K9n$@`zNHixbC|+-?J&v;8mrPQG618X8(4bKK9t*jIRy z&Svoo-PgX`KC;**d?CVGH2TWM)1UuTJ$P7N!6;chwXRoC+YRU~22WQ%mvv4FO#qk& Ba%2Di literal 0 HcmV?d00001 diff --git a/art/phone/common/arrow_right_24px_W_G.png b/art/phone/common/arrow_right_24px_W_G.png new file mode 100644 index 0000000000000000000000000000000000000000..fac2209a659932b882d85c56c2bfec6c2af5baab GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#U7jwEAr*{or!3@cF%W5+trVca)5R;%V8C>y zF@-hkfYL^ugA6J<0r8R7yOw$W-z_|~d}l%Jvj^UGe@)-MPJZ)j*OpvvMV5W7a~U#c zCCRvFtj%OPxJhT@I_*8*O&Sv}n^^QU>wPft6yiC|uvElXVa9XIXO(TmeQE-0R&m|l zwwJfyoANPw+WOVcZ{oRZaxhBzdzZ!Y7r*6#PW|YQxo-Ncw%>l4YhXg;v>)=l jC7~s;?)%>4{cB;ry?VA~LvnUJ&=(Azu6{1-oD!M<>jrJ@ literal 0 HcmV?d00001 diff --git a/art/phone/common/plus_32px_W_G.png b/art/phone/common/plus_32px_W_G.png new file mode 100644 index 0000000000000000000000000000000000000000..8d0ba037b37061e8adbd8174d99cca5e35affa17 GIT binary patch literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07Sip>6gA}f5OZp6?_IkQFhD30_ z4Rz!?qQK)beebKuA%AAXe_~x!captCnty4p&J>4}s?3cmGTJ!(w*6(`c%&RrJuQqW zht*3nVeQ;TOYt10z2y?gXAaEaHe<|ltn%kv!L+Jj2b1*Nwij9cJxi}~t=;-_?cVPK zP7C5|BCVe*9ILqR&J-?@Twt?b=!aQr1^2#kTZW=@>$f#rW7ax(xzy`rj_|XXj_nRm zgSv(F{Jy3$v!8zW_OnQ_-n7gUwH?*|dsw|5uy1O5RPQXlzXIeTPgg&ebxsLQ09GSw AWB>pF literal 0 HcmV?d00001 diff --git a/art/phone/common/search_32px_W_G.png b/art/phone/common/search_32px_W_G.png new file mode 100644 index 0000000000000000000000000000000000000000..e8e49c4e4975d5fcfb0af7f939f99dfe6b8d18a3 GIT binary patch literal 795 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07Sip>6gA}f5OZv>fz|`vL;usRa zc{JSjbfKe!+85-mVe{sDf@p|c;w>4_zrxU)*gN1n5LjP_H zUl60WI_+G`%c7lEeE4cl7@A%*_$IoIr^ij%k?m2|R+cE?Gw3S(`K8LX@{!WE zlm~MwRD=voTjZDA%u!>BXAWk5f8_O7t6Cd5k)K{m7v1?Dw|@GfjmgWtD7H%}OGp_A zU01HPn=f*f@1E2K?L7C8byrP4L_acEWcXqBBPr&`A0xi6c-Z_~Bt-i{j+yE4SCb#j z65SEEeoKT7m+*YC>k5~zx@rdJMFnn*H8GfVwKCcQs#Pwx7&5h T^a@Vff)b{utDnm{r-UW|k*Hc4 literal 0 HcmV?d00001 diff --git a/image/assets/images/arrow_left_24px_W_G.vpi b/image/assets/images/arrow_left_24px_W_G.vpi new file mode 100644 index 0000000000000000000000000000000000000000..e0b6b728416b418016d35dd59f075e7458f4fd98 GIT binary patch literal 401 zcmaKo+YW#r3`2_u2;O+)|G(5uT>?Q&7zw9aH&#%P4S+Jd9aW!!bOL5)%<@(mg$7`{ zv;3PIgeC^9ZKF6*HU{zIp*2>NgF!&Us>dWs1b8ZHR#LWQn;}(ib&z?MW}d#Q){H0Z OfA_r&rS0baw|xOt#RjDS literal 0 HcmV?d00001 diff --git a/image/assets/images/arrow_right_24px_W_G.vpi b/image/assets/images/arrow_right_24px_W_G.vpi new file mode 100644 index 0000000000000000000000000000000000000000..f36bb4383bc25b03fab840112f54dbbcf0b1e91d GIT binary patch literal 401 zcmaKo+YZ7o3`37Mc4fdG`~P2xJ1vN4l!sQTPvbZ#6m|inc@L)J4!Zd~V13nhsGX@M zSPpeO|Mpe2tyY*4sdX~e216n?K{n76`b6e%TcA5gbhkZn1l_+g{Z?I!J`Rzz-L;+c PI$h+++Xyvp?*F#mOA!X8 literal 0 HcmV?d00001 diff --git a/image/assets/images/plus_32px_W_G.vpi b/image/assets/images/plus_32px_W_G.vpi new file mode 100644 index 0000000000000000000000000000000000000000..e16a0a79c229ff8eeee2c0433beaf6b4a60150bb GIT binary patch literal 597 zcmY#jP+$;XWME)W;Kw9cf#Q7p3=E9i3=B*_Hi+iqhl{d9MS=9t6XgW@hXv|4PM{AM nnW4S`(qKN&uPppP4p@~0m`3FhXTtCZEx0dGQUYd*frtPAaHa{F literal 0 HcmV?d00001 diff --git a/image/assets/images/search_32px_W_G.vpi b/image/assets/images/search_32px_W_G.vpi new file mode 100644 index 0000000000000000000000000000000000000000..a1ad623d52d8120172f63b2f4935a8535003a3a6 GIT binary patch literal 893 zcma)*$99D<3`Aux<+V7y?D+q$%$>0foUF0{p;4KUEwU-h)r9`AV&l)iR z$jZMIMT?>r9tviBS^0~j4@IANa>P|pto*5v5{?cLfRV7nRBiXCawBqA4g7I2cLr8|jT%9V5NUKK{$K`2;p+^Z zqB96L!#{d(TJHR48nE`kE0ZUN#!Q@pdt&YLI!(;Yxt2M6E^Qv&XwB*>oy8T+Iv1>c z)Mwv_8L5RN5+P*_Ozu6v_x&+rF3PYTvS}4bRRub>r+Gr@EKEC~+nozT?h4JKy=xWP zh5fFmv`^pFY|FVXRj)=pM^_B`W_0?K`)<^`b;|uPIx3f$x|+`eMY<=Z@7K|xZx`ry SQQT~JI;EfXe<6SW*M0$tPYe41 literal 0 HcmV?d00001 diff --git a/module-apps/application-bell-main/windows/BellMainMenuWindow.cpp b/module-apps/application-bell-main/windows/BellMainMenuWindow.cpp index 3d74b5fd9671fc7bbf86aef6d37ad1e1a42ef3ee..c8101b1b336e3ae75f9ac05341f81a7a9f8c15e9 100644 --- a/module-apps/application-bell-main/windows/BellMainMenuWindow.cpp +++ b/module-apps/application-bell-main/windows/BellMainMenuWindow.cpp @@ -20,9 +20,10 @@ namespace gui void BellMainMenuWindow::buildInterface() { - bottomBar->setVisible(false); statusBar->setVisible(false); - title->visible = false; + header->setTitleVisibility(false); + bottomBar->setVisible(false); + optionsList->setPosition(bellMainStyle::mainMenuWindow::options_list_x, bellMainStyle::mainMenuWindow::options_list_y); optionsList->setMaximumWidth(bellMainStyle::mainMenuWindow::default_body_width); diff --git a/module-apps/application-meditation/windows/MeditationTimerWindow.cpp b/module-apps/application-meditation/windows/MeditationTimerWindow.cpp index 03addbb348dc17eec6d196f05ccfa3b7e4de3961..ea495e94d5002395bd30a930ba343ec694d45e4d 100644 --- a/module-apps/application-meditation/windows/MeditationTimerWindow.cpp +++ b/module-apps/application-meditation/windows/MeditationTimerWindow.cpp @@ -129,7 +129,7 @@ void MeditationTimerWindow::setWidgetVisible(bool sBar, bool bBar, bool counter) return configuration; }); - title->setVisible(sBar); + header->setTitleVisibility(sBar); bottomBar->setActive(BottomBar::Side::CENTER, bBar); bottomBar->setActive(BottomBar::Side::LEFT, bBar); timer->setVisible(counter); diff --git a/module-apps/application-onboarding/windows/ConfigurationSuccessfulDialogWindow.cpp b/module-apps/application-onboarding/windows/ConfigurationSuccessfulDialogWindow.cpp index a14389cfe33363c1b092730b6f7bfeff63d229ad..fbde74b3178e0f3722a24e68088ce3cd0afc1f93 100644 --- a/module-apps/application-onboarding/windows/ConfigurationSuccessfulDialogWindow.cpp +++ b/module-apps/application-onboarding/windows/ConfigurationSuccessfulDialogWindow.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include
#include #include @@ -17,10 +17,9 @@ namespace app::onBoarding ConfigurationSuccessfulDialogWindow::ConfigurationSuccessfulDialogWindow(app::Application *app) : gui::Dialog(app, gui::window::name::onBoarding_configuration_successful) { + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); bottomBar->setText(gui::BottomBar::Side::CENTER, utils::translate(style::strings::common::start)); bottomBar->setActive(gui::BottomBar::Side::RIGHT, false); - - new gui::IceBox(this); } bool ConfigurationSuccessfulDialogWindow::onInput(const gui::InputEvent &inputEvent) diff --git a/module-apps/application-onboarding/windows/NoConfigurationDialogWindow.cpp b/module-apps/application-onboarding/windows/NoConfigurationDialogWindow.cpp index 90b3e6d97bb66fa99d9c3e5819a6ce735901d679..3def4cc4fcce9f90dc980298f1f0ff0561ba700e 100644 --- a/module-apps/application-onboarding/windows/NoConfigurationDialogWindow.cpp +++ b/module-apps/application-onboarding/windows/NoConfigurationDialogWindow.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include
#include #include @@ -17,10 +17,9 @@ namespace app::onBoarding NoConfigurationDialogWindow::NoConfigurationDialogWindow(app::Application *app) : gui::Dialog(app, gui::window::name::onBoarding_no_configuration) { + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); bottomBar->setText(gui::BottomBar::Side::CENTER, utils::translate(style::strings::common::start)); bottomBar->setActive(gui::BottomBar::Side::RIGHT, false); - - new gui::IceBox(this); } bool NoConfigurationDialogWindow::onInput(const gui::InputEvent &inputEvent) diff --git a/module-apps/application-onboarding/windows/OnBoardingDateAndTimeWindow.cpp b/module-apps/application-onboarding/windows/OnBoardingDateAndTimeWindow.cpp index 7955db947067bda05f42c025a69db16c0944647b..7131d05fdceced5d832cd6b12fab8361a30cc20f 100644 --- a/module-apps/application-onboarding/windows/OnBoardingDateAndTimeWindow.cpp +++ b/module-apps/application-onboarding/windows/OnBoardingDateAndTimeWindow.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include
#include namespace app::onBoarding @@ -27,7 +27,7 @@ namespace app::onBoarding void OnBoardingDateAndTimeWindow::onBeforeShow(gui::ShowMode mode, gui::SwitchData *data) { DateAndTimeMainWindow::onBeforeShow(mode, data); - new gui::IceBox(this); + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); bottomBar->setText(gui::BottomBar::Side::CENTER, utils::translate(style::strings::common::save)); bottomBar->setText(gui::BottomBar::Side::LEFT, utils::translate(style::strings::common::Switch)); diff --git a/module-apps/application-onboarding/windows/OnBoardingLanguagesWindow.cpp b/module-apps/application-onboarding/windows/OnBoardingLanguagesWindow.cpp index db2d8ced8d40237606411503385cc1463e9f7aa5..f443f72ce535ad0b5e94ad7fc5f0b2a6eb49fe34 100644 --- a/module-apps/application-onboarding/windows/OnBoardingLanguagesWindow.cpp +++ b/module-apps/application-onboarding/windows/OnBoardingLanguagesWindow.cpp @@ -4,7 +4,7 @@ #include "OnBoardingLanguagesWindow.hpp" #include -#include +#include
#include #include @@ -16,8 +16,8 @@ namespace app::onBoarding void OnBoardingLanguagesWindow::onBeforeShow(gui::ShowMode mode, gui::SwitchData *data) { + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); bottomBar->setActive(gui::BottomBar::Side::RIGHT, false); - new gui::IceBox(this); LanguagesWindow::onBeforeShow(mode, data); } diff --git a/module-apps/application-onboarding/windows/OnBoardingSimSelectWindow.cpp b/module-apps/application-onboarding/windows/OnBoardingSimSelectWindow.cpp index 481be31dd6f732e8afac7653608a6d821c057bb5..2c238231858b642c7b22357f44c75dad4b526edf 100644 --- a/module-apps/application-onboarding/windows/OnBoardingSimSelectWindow.cpp +++ b/module-apps/application-onboarding/windows/OnBoardingSimSelectWindow.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include
#include #include @@ -22,13 +22,11 @@ namespace app::onBoarding void OnBoardingSimSelectWindow::buildInterface() { setTitle(utils::translate("app_onboarding_select_sim")); - + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); bottomBar->setText(gui::BottomBar::Side::CENTER, utils::translate(::style::strings::common::select)); bottomBar->setText(gui::BottomBar::Side::RIGHT, utils::translate(::style::strings::common::back)); bottomBar->setText(gui::BottomBar::Side::LEFT, utils::translate(::style::strings::common::skip)); - new gui::IceBox(this); - descriptionText = new gui::Text(this, style::window::default_left_margin, style::onboarding::sim_select::description_y, diff --git a/module-apps/application-onboarding/windows/StartConfigurationWindow.cpp b/module-apps/application-onboarding/windows/StartConfigurationWindow.cpp index 5b84b5c4b24761aea5cd0f0425b9bd04a42d0c71..f124d242b207e9ea30ed17045f974a9256c397ec 100644 --- a/module-apps/application-onboarding/windows/StartConfigurationWindow.cpp +++ b/module-apps/application-onboarding/windows/StartConfigurationWindow.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include
#include #include @@ -27,11 +27,11 @@ namespace app::onBoarding { AppWindow::buildInterface(); + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); bottomBar->setText(gui::BottomBar::Side::CENTER, utils::translate(::style::strings::common::start)); bottomBar->setText(gui::BottomBar::Side::RIGHT, utils::translate(::style::strings::common::back)); bottomBar->setText(gui::BottomBar::Side::LEFT, utils::translate(::style::strings::common::skip)); - new gui::IceBox(this); new gui::Icon(this, 0, 0, diff --git a/module-apps/application-phonebook/windows/PhonebookContactDetails.cpp b/module-apps/application-phonebook/windows/PhonebookContactDetails.cpp index 126cd3d29472a935150c1b9ca0741dd5becd5cfa..75dce1ceac50c60803bb4c22faf944f604e717d9 100644 --- a/module-apps/application-phonebook/windows/PhonebookContactDetails.cpp +++ b/module-apps/application-phonebook/windows/PhonebookContactDetails.cpp @@ -82,13 +82,13 @@ namespace gui contactFlagsWidget->setBlocked(contact->isOnBlocked()); contactFlagsWidget->setFavourites(contact->isOnFavourites()); if (contactFlagsWidget->visible) { - title->setEdges(RectangleEdge::None); + header->setEdges(RectangleEdge::None); bodyList->setY(phonebookStyle::contactDetailsWindow::contactDetailsList::y); bodyList->setSize(phonebookStyle::contactDetailsWindow::contactDetailsList::w, phonebookStyle::contactDetailsWindow::contactDetailsList::h); } else { - title->setEdges(RectangleEdge::Bottom); + header->setEdges(RectangleEdge::Bottom); bodyList->setY(phonebookStyle::contactDetailsWindow::contactDetailsListNoFlags::y); bodyList->setSize(phonebookStyle::contactDetailsWindow::contactDetailsListNoFlags::w, phonebookStyle::contactDetailsWindow::contactDetailsListNoFlags::h); diff --git a/module-apps/apps-common/CMakeLists.txt b/module-apps/apps-common/CMakeLists.txt index fd614364334b02b39a74c112bf54aee9c52a2cb6..df8e254bea743e0d8a84b6ba0664669d8e6f25de 100644 --- a/module-apps/apps-common/CMakeLists.txt +++ b/module-apps/apps-common/CMakeLists.txt @@ -27,7 +27,6 @@ target_sources(apps-common widgets/BrightnessBox.cpp widgets/ButtonOnOff.cpp widgets/DateWidget.cpp - widgets/IceBox.cpp widgets/InputBox.cpp widgets/ModesBox.cpp widgets/TextWithIconsWidget.cpp diff --git a/module-apps/apps-common/locks/windows/LockInputWindow.cpp b/module-apps/apps-common/locks/windows/LockInputWindow.cpp index 7ec18ac2a11c7e6ac03d5f8df3a61def5051a83e..5c12582b3fbd0e8acd9264de2b1baeb78ea201af 100644 --- a/module-apps/apps-common/locks/windows/LockInputWindow.cpp +++ b/module-apps/apps-common/locks/windows/LockInputWindow.cpp @@ -7,6 +7,7 @@ #include #include +#include
#include #include @@ -72,7 +73,7 @@ namespace gui void LockInputWindow::buildIceBox() { - iceBox = new gui::IceBox(this); + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); } void LockInputWindow::buildPinBody() @@ -138,14 +139,13 @@ namespace gui { switch (type) { case TextType::Title: { - title->setVisible(true); + header->setTitleVisibility(true); if (!tokens.empty()) { TextFormat format(FontManager::getInstance().getFont(style::window::font::medium)); - title->setText( - text::RichTextParser().parse(utils::translate(value), &format, std::move(tokens))->getText()); + setTitle(text::RichTextParser().parse(utils::translate(value), &format, std::move(tokens))->getText()); } else { - title->setText(utils::translate(value)); + setTitle(utils::translate(value)); } break; } @@ -162,8 +162,14 @@ namespace gui void LockInputWindow::setTitleBar(bool titleVisible, bool iceVisible) { - title->setVisible(titleVisible); - iceBox->setVisible(iceVisible); + header->setTitleVisibility(titleVisible); + + if (iceVisible) { + header->navigationIndicatorAdd(new gui::header::IceAction(), gui::header::BoxSelection::Left); + } + else { + header->navigationIndicatorRemove(gui::header::BoxSelection::Left); + } } auto LockInputWindow::getToken(LockInputWindow::Token token) const -> std::string @@ -216,7 +222,7 @@ namespace gui auto LockInputWindow::isIceVisible() const noexcept -> bool { - return iceBox->visible; + return header->navigationIndicatorVisible(header::BoxSelection::Left); } auto LockInputWindow::isInInputState() const noexcept -> bool diff --git a/module-apps/apps-common/locks/windows/LockInputWindow.hpp b/module-apps/apps-common/locks/windows/LockInputWindow.hpp index eea5cad3302df5cf0047bf19957a8bad5186ba8a..9b30a0b19266f34441bad7b2c2fb1c191f118cfe 100644 --- a/module-apps/apps-common/locks/windows/LockInputWindow.hpp +++ b/module-apps/apps-common/locks/windows/LockInputWindow.hpp @@ -9,7 +9,6 @@ #include #include #include -#include namespace locks { @@ -67,7 +66,6 @@ namespace gui private: gui::VBox *body = nullptr; - gui::IceBox *iceBox = nullptr; gui::ImageBox *infoImage = nullptr; gui::Text *primaryText = nullptr; gui::Text *secondaryText = nullptr; diff --git a/module-apps/apps-common/widgets/IceBox.hpp b/module-apps/apps-common/widgets/IceBox.hpp deleted file mode 100644 index b61511b6fe141a00620ebf00b72ca5c085cb3125..0000000000000000000000000000000000000000 --- a/module-apps/apps-common/widgets/IceBox.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. -// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -#pragma once - -#include -#include -#include - -namespace style::window::ice -{ - constexpr inline auto x = 25; - constexpr inline auto y = 53; - constexpr inline auto w = 60; - constexpr inline auto h = 38; - - constexpr inline auto margin = 3; - - namespace text - { - constexpr inline auto w = 40; - } -} // namespace style::window::ice - -namespace gui -{ - class IceBox : public HBox - { - public: - explicit IceBox(Item *parent = nullptr); - }; -} // namespace gui diff --git a/module-apps/apps-common/windows/AppWindow.cpp b/module-apps/apps-common/windows/AppWindow.cpp index f5ace9f2f789505506091d1f07ad51122df70383..335abbcee33cad726886db844a3d95e45c632294 100644 --- a/module-apps/apps-common/windows/AppWindow.cpp +++ b/module-apps/apps-common/windows/AppWindow.cpp @@ -24,12 +24,12 @@ namespace gui void AppWindow::destroyInterface() { - erase(bottomBar); erase(statusBar); - erase(title); - title = nullptr; - bottomBar = nullptr; + erase(header); + erase(bottomBar); statusBar = nullptr; + header = nullptr; + bottomBar = nullptr; } void AppWindow::rebuild() @@ -46,19 +46,16 @@ namespace gui status_bar::height); statusBar->configure(std::move(config)); + header = new gui::header::Header(this, + style::header::default_horizontal_pos, + style::header::default_vertical_pos, + style::header::width, + style::header::height); + bottomBar = new gui::BottomBar(this, 0, style::window_height - 51, style::window_width, 50); bottomBar->setActive(BottomBar::Side::LEFT, false); bottomBar->setActive(BottomBar::Side::CENTER, false); bottomBar->setActive(BottomBar::Side::RIGHT, false); - - title = new gui::Label(this, 0, 52, style::window_width, 52); - title->setFilled(false); - title->setFont(font::title); - title->clear(); - title->setAlignment(gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Top)); - title->setEdges(RectangleEdge::Bottom); - title->setEllipsis(Ellipsis::Right); - title->visible = false; } status_bar::Configuration AppWindow::configureStatusBar(status_bar::Configuration appConfiguration) @@ -132,13 +129,12 @@ namespace gui void AppWindow::setTitle(const UTF8 &text) { - if (title != nullptr) { - title->setText(text); - title->setVisible(text.length() != 0); - } - else { - LOG_ERROR("cant set title - it doesn't exist!"); - } + header->setTitle(text); + } + + UTF8 AppWindow::getTitle() + { + return header->getTitle(); } bool AppWindow::onDatabaseMessage(sys::Message *msg) @@ -265,9 +261,9 @@ namespace gui BoundingBox AppWindow::bodySize() { return {0, - title->offset_h(), + header->offset_h(), this->getWidth(), - this->getHeight() - this->title->offset_h() - bottomBar->getHeight()}; + this->getHeight() - this->header->offset_h() - bottomBar->getHeight()}; } void AppWindow::setBottomBarActive(BottomBar::Side side, bool value) diff --git a/module-apps/apps-common/windows/AppWindow.hpp b/module-apps/apps-common/windows/AppWindow.hpp index edd387aa6f11d2c8b154da7879230a2fbb513fc9..1bb6e8e5ba3bd405f5dbfe2f9e9694eb1e1baee5 100644 --- a/module-apps/apps-common/windows/AppWindow.hpp +++ b/module-apps/apps-common/windows/AppWindow.hpp @@ -4,6 +4,7 @@ #pragma once #include +#include #include #include #include @@ -31,16 +32,18 @@ namespace gui class AppWindow : public Window { protected: - /// actual built window title - gui::Label *title = nullptr; - /** - * Information bar for the buttons on the bottom of the page. - */ - gui::BottomBar *bottomBar = nullptr; /** * Information bar for signal, battery and lock icon on the top of the screen. */ gui::status_bar::StatusBar *statusBar = nullptr; + /** + * Information bar for window title and additional action buttons. + */ + gui::header::Header *header = nullptr; + /** + * Information bar for the buttons on the bottom of the page. + */ + gui::BottomBar *bottomBar = nullptr; /** * Pointer to the application object that owns the window. */ @@ -75,7 +78,6 @@ namespace gui void updatePhoneMode(sys::phone_modes::PhoneMode mode); [[nodiscard]] bool preventsAutoLocking() const noexcept; virtual bool updateTime(); - void setTitle(const UTF8 &text); void rebuild() override; void buildInterface() override; @@ -96,6 +98,9 @@ namespace gui */ void applyToStatusBar(StatusBarConfigurationChangeFunction configChange); + void setTitle(const UTF8 &text); + [[nodiscard]] UTF8 getTitle(); + /// Setting bottom bar temporary text /// @param text - bottomBar text /// @param overwriteOthers - set or not other bottomBar texts to "" (default true) diff --git a/module-apps/apps-common/windows/NoEvents.cpp b/module-apps/apps-common/windows/NoEvents.cpp index e998251f824f2cc9fc6e569814e7e9ac0b413b06..ba3713c974110afac8b30ecc2c8cdc5485c5d592 100644 --- a/module-apps/apps-common/windows/NoEvents.cpp +++ b/module-apps/apps-common/windows/NoEvents.cpp @@ -58,7 +58,7 @@ void NoEvents::onBeforeShow(ShowMode mode, SwitchData *data) }; } - if (title->getText() == utils::translate("app_calendar_title_main")) { + if (getTitle() == utils::translate("app_calendar_title_main")) { bottomBar->setActive(gui::BottomBar::Side::LEFT, true); bottomBar->setText(gui::BottomBar::Side::LEFT, utils::translate("app_calendar_bar_month")); } @@ -66,8 +66,7 @@ void NoEvents::onBeforeShow(ShowMode mode, SwitchData *data) bool NoEvents::onInput(const gui::InputEvent &inputEvent) { - if (inputEvent.isShortRelease(gui::KeyCode::KEY_RF) && - title->getText() == utils::translate("app_calendar_title_main")) { + if (inputEvent.isShortRelease(gui::KeyCode::KEY_RF) && getTitle() == utils::translate("app_calendar_title_main")) { app::manager::Controller::switchBack(application); return true; } @@ -76,8 +75,7 @@ bool NoEvents::onInput(const gui::InputEvent &inputEvent) return true; } - if (inputEvent.isShortRelease(gui::KeyCode::KEY_LF) && - title->getText() == utils::translate("app_calendar_title_main")) { + if (inputEvent.isShortRelease(gui::KeyCode::KEY_LF) && getTitle() == utils::translate("app_calendar_title_main")) { application->switchWindow(gui::name::window::main_window); return true; } diff --git a/module-gui/WINDOW.md b/module-gui/WINDOW.md index 17fb8ed9dc4675e31ff60c7b3809201b741d64c5..bbe3c607915b4164349a5dd58bb107ba71f19c1c 100644 --- a/module-gui/WINDOW.md +++ b/module-gui/WINDOW.md @@ -13,9 +13,9 @@ Window consist of 4 different segments presented on image below. selected sim. Objects in status bar are not focusable and activeable. * `Header` - Displaying selected window information. Mainly its title and in addition window particular input actions descriptions. In example adding object to list, search and emergency calls action. Objects in header are not focusable -and activeable. Currently that part is not clearly represented in Code and is being refactored. +and activeable. * `Body` - Main part of window responsible for displaying and manipulating window logic. In example: contact information, sms list manipulations, alarm clock settings. Objects in Body are focusable and activeable. * `NavBar` - Bottom part of window displaying input action descriptions assigned to main keyboard keys (Left Function key, Enter Key, Right Function Key). In example: accepting prompt, going to previous window, selecting object. Objects in -NavBar are not focusable and activeable. Currently that part is named BottomBar in Code. \ No newline at end of file +NavBar are not focusable and activeable. Currently, that part is named BottomBar in Code. \ No newline at end of file diff --git a/module-gui/gui/widgets/CMakeLists.txt b/module-gui/gui/widgets/CMakeLists.txt index 4be83f6de3daf1fb6e8296fe816be47407672fc0..02da060d598f5497c6dcccfea98bff15d1ab759f 100644 --- a/module-gui/gui/widgets/CMakeLists.txt +++ b/module-gui/gui/widgets/CMakeLists.txt @@ -20,6 +20,10 @@ target_sources( ${PROJECT_NAME} "${CMAKE_CURRENT_LIST_DIR}/Window.cpp" "${CMAKE_CURRENT_LIST_DIR}/BoxLayout.cpp" "${CMAKE_CURRENT_LIST_DIR}/BoxLayoutSizeStore.cpp" + "${CMAKE_CURRENT_LIST_DIR}/header/Header.cpp" + "${CMAKE_CURRENT_LIST_DIR}/header/IceAction.cpp" + "${CMAKE_CURRENT_LIST_DIR}/header/AddElementAction.cpp" + "${CMAKE_CURRENT_LIST_DIR}/header/SearchAction.cpp" "${CMAKE_CURRENT_LIST_DIR}/StatusBar.cpp" "${CMAKE_CURRENT_LIST_DIR}/status-bar/SIM.cpp" "${CMAKE_CURRENT_LIST_DIR}/status-bar/BatteryBase.cpp" @@ -72,6 +76,10 @@ target_sources( ${PROJECT_NAME} "${CMAKE_CURRENT_LIST_DIR}/Layout.hpp" "${CMAKE_CURRENT_LIST_DIR}/StatusBar.hpp" "${CMAKE_CURRENT_LIST_DIR}/Text.hpp" + "${CMAKE_CURRENT_LIST_DIR}/header/Header.hpp" + "${CMAKE_CURRENT_LIST_DIR}/header/IceAction.hpp" + "${CMAKE_CURRENT_LIST_DIR}/header/AddElementAction.hpp" + "${CMAKE_CURRENT_LIST_DIR}/header/SearchAction.hpp" "${CMAKE_CURRENT_LIST_DIR}/CheckBoxWithLabel.hpp" "${CMAKE_CURRENT_LIST_DIR}/CheckBoxWithLabel.hpp" "${CMAKE_CURRENT_LIST_DIR}/Lines.hpp" diff --git a/module-gui/gui/widgets/header/AddElementAction.cpp b/module-gui/gui/widgets/header/AddElementAction.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1da0d9f4348b73bbfd848dc27c81bcb5ab8af0c7 --- /dev/null +++ b/module-gui/gui/widgets/header/AddElementAction.cpp @@ -0,0 +1,30 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#include "AddElementAction.hpp" +#include "Style.hpp" + +#include +#include + +namespace gui::header +{ + AddElementAction::AddElementAction(Item *parent) + : HBox(parent, 0, 0, style::header::navigation_indicator::w, style::header::navigation_indicator::h) + { + setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); + setEdges(RectangleEdge::None); + setMargins(Margins(style::header::navigation_indicator::right_left_margin, + style::header::navigation_indicator::top_margin, + 0, + 0)); + + auto arrow = new gui::Image("arrow_left_24px_W_G"); + arrow->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); + addWidget(arrow); + + auto plus = new gui::Image("plus_32px_W_G"); + plus->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); + addWidget(plus); + } +} // namespace gui::header diff --git a/module-gui/gui/widgets/header/AddElementAction.hpp b/module-gui/gui/widgets/header/AddElementAction.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f7751518ccd3ce977f0d61b943a731694f9f233d --- /dev/null +++ b/module-gui/gui/widgets/header/AddElementAction.hpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#pragma once + +#include + +namespace gui::header +{ + class AddElementAction : public HBox + { + public: + explicit AddElementAction(Item *parent = nullptr); + }; +} // namespace gui::header diff --git a/module-gui/gui/widgets/header/Header.cpp b/module-gui/gui/widgets/header/Header.cpp new file mode 100644 index 0000000000000000000000000000000000000000..059428122f3259ced9984b126ad6eace39e081cf --- /dev/null +++ b/module-gui/gui/widgets/header/Header.cpp @@ -0,0 +1,157 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#include "Header.hpp" +#include "Style.hpp" + +#include + +namespace gui::header +{ + Header::Header(Item *parent, Position x, Position y, Length w, Length h) : HBox(parent, x, y, w, h) + { + setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Center)); + setEdges(RectangleEdge::None); + + leftBox = new HBox(this, 0, 0, 0, 0); + leftBox->setMinimumSize(style::header::navigation_indicator::box_width, h); + leftBox->setAlignment(Alignment(Alignment::Vertical::Top)); + leftBox->setEdges(RectangleEdge::None); + leftBox->setVisible(false); + + centerBox = new HBox(this, 0, 0, 0, 0); + centerBox->setEdges(RectangleEdge::None); + centerBox->setAlignment(Alignment(gui::Alignment::Horizontal::Center)); + centerBox->setMaximumSize(w, h); + + rightBox = new HBox(this, 0, 0, 0, 0); + rightBox->setMinimumSize(style::header::navigation_indicator::box_width, h); + rightBox->setAlignment(Alignment(Alignment::Vertical::Top)); + rightBox->setEdges(RectangleEdge::None); + rightBox->setVisible(false); + } + + Item *Header::createTitle(const UTF8 &text) + { + title = new gui::Label(nullptr, 0, 0, 0, 0); + title->setMaximumSize(getWidth(), getHeight()); + title->setFont(style::header::font::title); + title->setAlignment(gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Top)); + title->setPadding(gui::Padding(0, style::header::title::top_padding, 0, 0)); + title->setEdges(RectangleEdge::None); + title->setEllipsis(Ellipsis::Right); + title->setVisible(true); + title->setText(text); + return title; + } + + void Header::showOuterBoxes() + { + leftBox->setVisible(true); + rightBox->setVisible(true); + resizeItems(); + } + + void Header::hideOuterBoxes() + { + if (rightBox->empty() && leftBox->empty()) { + rightBox->setVisible(false); + leftBox->setVisible(false); + } + } + + void Header::addToLeftBox(Item *item) + { + leftBox->erase(); + showOuterBoxes(); + leftBox->addWidget(item); + + leftBox->resizeItems(); + } + + void Header::addToCenterBox(Item *item) + { + centerBox->erase(); + centerBox->addWidget(item); + + centerBox->resizeItems(); + } + + void Header::addToRightBox(Item *item) + { + rightBox->erase(); + showOuterBoxes(); + rightBox->addWidget(item); + + rightBox->resizeItems(); + } + + void Header::setTitle(const UTF8 &text) + { + addToCenterBox(createTitle(text)); + + setEdges(RectangleEdge::Bottom); + resizeItems(); + } + + UTF8 Header::getTitle() + { + return title ? title->getText() : ""; + } + + void Header::setTitleVisibility(bool visibility) + { + if (title) { + visibility ? setEdges(RectangleEdge::Bottom) : setEdges(RectangleEdge::None); + title->setVisible(visibility); + } + } + + void Header::navigationIndicatorAdd(Item *item, BoxSelection boxSelection) + { + switch (boxSelection) { + case BoxSelection::Left: + addToLeftBox(item); + break; + case BoxSelection::Center: + addToCenterBox(item); + break; + case BoxSelection::Right: + addToRightBox(item); + break; + } + + resizeItems(); + } + + void Header::navigationIndicatorRemove(BoxSelection boxSelection) + { + switch (boxSelection) { + case BoxSelection::Left: + leftBox->erase(); + break; + case BoxSelection::Center: + centerBox->erase(); + break; + case BoxSelection::Right: + rightBox->erase(); + break; + } + + hideOuterBoxes(); + resizeItems(); + } + + bool Header::navigationIndicatorVisible(BoxSelection boxSelection) + { + switch (boxSelection) { + case BoxSelection::Left: + return leftBox->visible; + case BoxSelection::Center: + return centerBox->visible; + case BoxSelection::Right: + return rightBox->visible; + } + return false; + } +} // namespace gui::header diff --git a/module-gui/gui/widgets/header/Header.hpp b/module-gui/gui/widgets/header/Header.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bb80854f3054236a43c7e7225086f27830d4c53a --- /dev/null +++ b/module-gui/gui/widgets/header/Header.hpp @@ -0,0 +1,45 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#pragma once + +#include +#include +#include + +namespace gui::header +{ + enum class BoxSelection + { + Left, + Center, + Right + }; + + class Header : public HBox + { + private: + HBox *leftBox = nullptr; + HBox *centerBox = nullptr; + HBox *rightBox = nullptr; + Label *title = nullptr; + + Item *createTitle(const UTF8 &text); + + void hideOuterBoxes(); + void showOuterBoxes(); + void addToLeftBox(Item *item); + void addToCenterBox(Item *item); + void addToRightBox(Item *item); + + public: + Header(Item *parent, Position x, Position y, Length w, Length h); + void setTitle(const UTF8 &text); + [[nodiscard]] UTF8 getTitle(); + void setTitleVisibility(bool visibility); + + void navigationIndicatorAdd(Item *item, BoxSelection position); + void navigationIndicatorRemove(BoxSelection position); + [[nodiscard]] bool navigationIndicatorVisible(BoxSelection position); + }; +} // namespace gui::header diff --git a/module-apps/apps-common/widgets/IceBox.cpp b/module-gui/gui/widgets/header/IceAction.cpp similarity index 51% rename from module-apps/apps-common/widgets/IceBox.cpp rename to module-gui/gui/widgets/header/IceAction.cpp index 3511601f56863322c309d6c9cb20a3d86599dfc9..3b185f026da25d99b558a827f465353fa8b2cda0 100644 --- a/module-apps/apps-common/widgets/IceBox.cpp +++ b/module-gui/gui/widgets/header/IceAction.cpp @@ -1,30 +1,36 @@ // Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md -#include "IceBox.hpp" +#include "IceAction.hpp" +#include "Style.hpp" #include +#include #include -namespace gui +namespace gui::header { - IceBox::IceBox(Item *parent) - : HBox(parent, style::window::ice::x, style::window::ice::y, style::window::ice::w, style::window::ice::h) + IceAction::IceAction(Item *parent) + : HBox(parent, 0, 0, style::header::navigation_indicator::w, style::header::navigation_indicator::h) { setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); setEdges(RectangleEdge::None); + setMargins(Margins(style::header::navigation_indicator::right_left_margin, + style::header::navigation_indicator::top_margin, + 0, + 0)); - auto arrow = new gui::Image("left_label_arrow"); + auto arrow = new gui::Image("arrow_left_24px_W_G"); arrow->activeItem = false; arrow->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); - arrow->setMargins(Margins(0, 0, style::window::ice::margin, 0)); addWidget(arrow); - auto iceText = new gui::Text(nullptr, 0, 0, style::window::ice::text::w, style::window::ice::h); + auto iceText = new gui::Text(nullptr, 0, 0, 0, 0); + iceText->setMaximumSize(style::header::navigation_indicator::ice_w, style::header::navigation_indicator::h); iceText->activeItem = false; iceText->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); iceText->setFont(style::window::font::verysmall); iceText->setText(utils::translate("app_desktop_emergency")); addWidget(iceText); } -} // namespace gui +} // namespace gui::header diff --git a/module-gui/gui/widgets/header/IceAction.hpp b/module-gui/gui/widgets/header/IceAction.hpp new file mode 100644 index 0000000000000000000000000000000000000000..aab3e71be65d36ede709517d0e014a9dbe2d1463 --- /dev/null +++ b/module-gui/gui/widgets/header/IceAction.hpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#pragma once + +#include + +namespace gui::header +{ + class IceAction : public HBox + { + public: + explicit IceAction(Item *parent = nullptr); + }; +} // namespace gui::header diff --git a/module-gui/gui/widgets/header/SearchAction.cpp b/module-gui/gui/widgets/header/SearchAction.cpp new file mode 100644 index 0000000000000000000000000000000000000000..77a8ce2fb6c5aa63d8f05df007585c4052465d5a --- /dev/null +++ b/module-gui/gui/widgets/header/SearchAction.cpp @@ -0,0 +1,31 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#include "SearchAction.hpp" +#include "Style.hpp" + +#include +#include + +namespace gui::header +{ + SearchAction::SearchAction(Item *parent) + : HBox(parent, 0, 0, style::header::navigation_indicator::w, style::header::navigation_indicator::h) + { + setAlignment(Alignment(Alignment::Horizontal::Right, Alignment::Vertical::Center)); + setEdges(RectangleEdge::None); + setMargins(Margins(0, + style::header::navigation_indicator::top_margin, + style::header::navigation_indicator::right_left_margin, + 0)); + setReverseOrder(true); + + auto arrow = new gui::Image("arrow_right_24px_W_G"); + arrow->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); + addWidget(arrow); + + auto search = new gui::Image("search_32px_W_G"); + search->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center)); + addWidget(search); + } +} // namespace gui::header diff --git a/module-gui/gui/widgets/header/SearchAction.hpp b/module-gui/gui/widgets/header/SearchAction.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6a9ae66a30aa35a884c34869a310dd2ca7afd92a --- /dev/null +++ b/module-gui/gui/widgets/header/SearchAction.hpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#pragma once + +#include + +namespace gui::header +{ + class SearchAction : public HBox + { + public: + explicit SearchAction(Item *parent = nullptr); + }; +} // namespace gui::header diff --git a/module-gui/gui/widgets/header/Style.hpp b/module-gui/gui/widgets/header/Style.hpp new file mode 100644 index 0000000000000000000000000000000000000000..03c66e8eb4290597280ccd70fccf9611d2b803ec --- /dev/null +++ b/module-gui/gui/widgets/header/Style.hpp @@ -0,0 +1,26 @@ +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#pragma once + +#include + +namespace style::header +{ + namespace title + { + inline constexpr auto top_padding = 6u; + }; // namespace title + + namespace navigation_indicator + { + inline constexpr auto h = 32u; + inline constexpr auto w = 60u; + inline constexpr auto ice_w = 40u; + inline constexpr auto top_margin = 7u; + inline constexpr auto right_left_margin = 22u; + + inline constexpr auto box_width = w + right_left_margin; + } // namespace navigation_indicator + +}; // namespace style::header