widget/menu: add setSubheadText() to set sub header text

Makes it possible to set text for sub headers without addIntroItems()


Origin commit data
------------------
Branch: ni/coolstream
Commit: 26ac78d0a2
Author: Thilo Graf <dbt@novatux.de>
Date: 2023-02-19 (Sun, 19 Feb 2023)



------------------
This commit was generated by Migit
This commit is contained in:
2023-02-19 22:33:10 +01:00
committed by vanhofen
parent e181adb1de
commit d397b0a206
2 changed files with 13 additions and 0 deletions

View File

@@ -1620,6 +1620,17 @@ void CMenuWidget::addIntroItems(neutrino_locale_t l_subhead_text, neutrino_local
addIntroItems(str, section_text, buttontype, brief_hint, separatorline);
}
void CMenuWidget::setSubheadText(const std::string &s_subhead_text)
{
subhead_text = s_subhead_text;
}
void CMenuWidget::setSubheadText(neutrino_locale_t l_subhead_text)
{
setSubheadText(g_Locale->getText(l_subhead_text));
}
void CMenuWidget::saveScreen()
{
if(!savescreen)

View File

@@ -635,6 +635,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals
};
void addIntroItems(neutrino_locale_t l_subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK, bool brief_hint = BRIEF_HINT_NO, bool separatorline = true);
void addIntroItems(const std::string &s_subhead_text, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK, bool brief_hint = BRIEF_HINT_NO, bool separatorline = true);
void setSubheadText(const std::string &s_subhead_text);
void setSubheadText(neutrino_locale_t l_subhead_text);
bool hasItem();
void resetWidget(bool delete_items = false);
void insertItem(const uint& item_id, CMenuItem* menuItem);