menue: allow brief hints in all introItems

Origin commit data
------------------
Branch: ni/coolstream
Commit: 524563f448
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-05-19 (Tue, 19 May 2015)

Origin message was:
------------------
- menue: allow brief hints in all introItems

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2015-05-19 12:28:28 +02:00
parent 9042501ffe
commit bc1abed6fa
2 changed files with 15 additions and 5 deletions

View File

@@ -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));

View File

@@ -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);