mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
gui/widget/menue.cpp: disable 'back' hint, if no other hints present
This commit is contained in:
@@ -491,7 +491,11 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GenericMenuBack->setHint(NEUTRINO_ICON_HINT_BACK, LOCALE_MENU_HINT_BACK);
|
GenericMenuBack->setHint("", NONEXISTANT_LOCALE);
|
||||||
|
checkHints();
|
||||||
|
if (has_hints)
|
||||||
|
GenericMenuBack->setHint(NEUTRINO_ICON_HINT_BACK, LOCALE_MENU_HINT_BACK);
|
||||||
|
|
||||||
if(savescreen) {
|
if(savescreen) {
|
||||||
calcSize();
|
calcSize();
|
||||||
saveScreen();
|
saveScreen();
|
||||||
@@ -666,6 +670,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
case menu_return::RETURN_EXIT_REPAINT:
|
case menu_return::RETURN_EXIT_REPAINT:
|
||||||
if (fade && washidden)
|
if (fade && washidden)
|
||||||
fader.StartFadeIn();
|
fader.StartFadeIn();
|
||||||
|
checkHints();
|
||||||
paint();
|
paint();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -693,6 +698,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
break;
|
break;
|
||||||
case (CRCInput::RC_help):
|
case (CRCInput::RC_help):
|
||||||
// FIXME should we switch hints in menu without hints ?
|
// FIXME should we switch hints in menu without hints ?
|
||||||
|
checkHints();
|
||||||
if (has_hints)
|
if (has_hints)
|
||||||
hide();
|
hide();
|
||||||
g_settings.show_menu_hints = !g_settings.show_menu_hints;
|
g_settings.show_menu_hints = !g_settings.show_menu_hints;
|
||||||
@@ -761,6 +767,19 @@ void CMenuWidget::hide()
|
|||||||
washidden = true;
|
washidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMenuWidget::checkHints()
|
||||||
|
{
|
||||||
|
GenericMenuBack->setHint("", NONEXISTANT_LOCALE);
|
||||||
|
for (unsigned int i= 0; i< items.size(); i++) {
|
||||||
|
if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE) {
|
||||||
|
has_hints = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (has_hints)
|
||||||
|
GenericMenuBack->setHint(NEUTRINO_ICON_HINT_BACK, LOCALE_MENU_HINT_BACK);
|
||||||
|
}
|
||||||
|
|
||||||
void CMenuWidget::calcSize()
|
void CMenuWidget::calcSize()
|
||||||
{
|
{
|
||||||
if (name != NONEXISTANT_LOCALE)
|
if (name != NONEXISTANT_LOCALE)
|
||||||
@@ -781,10 +800,11 @@ void CMenuWidget::calcSize()
|
|||||||
int tmpw = items[i]->getWidth() + 10 + 10 + wi; /* 10 pixels to the left and right of the text */
|
int tmpw = items[i]->getWidth() + 10 + 10 + wi; /* 10 pixels to the left and right of the text */
|
||||||
if (tmpw > width)
|
if (tmpw > width)
|
||||||
width = tmpw;
|
width = tmpw;
|
||||||
|
#if 0
|
||||||
if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE) {
|
if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE) {
|
||||||
has_hints = true;
|
has_hints = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
hint_height = 0;
|
hint_height = 0;
|
||||||
if(g_settings.show_menu_hints && has_hints) {
|
if(g_settings.show_menu_hints && has_hints) {
|
||||||
|
@@ -462,6 +462,7 @@ class CMenuWidget : public CMenuTarget
|
|||||||
|
|
||||||
void Init(const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index);
|
void Init(const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index);
|
||||||
virtual void paintItems();
|
virtual void paintItems();
|
||||||
|
void checkHints();
|
||||||
void calcSize();
|
void calcSize();
|
||||||
void saveScreen();
|
void saveScreen();
|
||||||
void restoreScreen();
|
void restoreScreen();
|
||||||
|
Reference in New Issue
Block a user