From 524563f44876f5da9ccd49d58ee480ae6a0b05e2 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 19 May 2015 12:28:28 +0200 Subject: [PATCH] - menue: allow brief hints in all introItems --- src/gui/widget/menue.cpp | 12 ++++++++---- src/gui/widget/menue.h | 8 +++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 194b2e00c..17bfdb0c1 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -567,6 +567,7 @@ void CMenuWidget::Init(const std::string &Icon, const int mwidth, const mn_widge savescreen = false; background = NULL; has_hints = false; + brief_hints = BRIEF_HINT_NO; hint_painted = false; hint_height = 0; fbutton_count = 0; @@ -1010,6 +1011,8 @@ void CMenuWidget::hide() void CMenuWidget::checkHints() { + brief_hints = (brief_hints || (from_wizard == SNeutrinoSettings::WIZARD_START)); + GenericMenuBack->setHint("", NONEXISTANT_LOCALE); GenericMenuNext->setHint("", NONEXISTANT_LOCALE); for (unsigned int i= 0; i< items.size(); i++) { @@ -1019,9 +1022,8 @@ void CMenuWidget::checkHints() } } if (has_hints) { - GenericMenuBack->setHint(NEUTRINO_ICON_HINT_BACK, LOCALE_MENU_HINT_BACK); - bool brief = (from_wizard == SNeutrinoSettings::WIZARD_START); - GenericMenuNext->setHint(NEUTRINO_ICON_HINT_NEXT, brief ? LOCALE_MENU_HINT_NEXT_BRIEF : LOCALE_MENU_HINT_NEXT); + GenericMenuBack->setHint(NEUTRINO_ICON_HINT_BACK, brief_hints ? LOCALE_MENU_HINT_BACK_BRIEF : LOCALE_MENU_HINT_BACK); + GenericMenuNext->setHint(NEUTRINO_ICON_HINT_NEXT, brief_hints ? LOCALE_MENU_HINT_NEXT_BRIEF : LOCALE_MENU_HINT_NEXT); } } @@ -1244,8 +1246,10 @@ void CMenuWidget::paintItems() } /*adds the typical menu intro with optional subhead, separator, back or cancel button and separatorline to menu*/ -void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_t section_text, int buttontype) +void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_t section_text, int buttontype, bool brief_hint) { + brief_hints = brief_hint; + if (subhead_text != NONEXISTANT_LOCALE) addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, subhead_text)); diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 968eba85e..670ebbf0e 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -517,6 +517,7 @@ class CMenuWidget : public CMenuTarget int full_width, full_height; bool savescreen; bool has_hints; // is any items has hints + bool brief_hints; bool hint_painted; // is hint painted int fbutton_width; @@ -557,7 +558,12 @@ class CMenuWidget : public CMenuTarget BTN_TYPE_NEXT = 3, BTN_TYPE_NO = -1 }; - virtual void addIntroItems(neutrino_locale_t subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK ); + enum + { + BRIEF_HINT_NO = 0, + BRIEF_HINT_YES = 1 + }; + virtual void addIntroItems(neutrino_locale_t subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK, bool brief_hint = BRIEF_HINT_NO); bool hasItem(); void resetWidget(bool delete_items = false); void insertItem(const uint& item_id, CMenuItem* menuItem);