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

Makes it possible to set text for sub headers without addIntroItems()
This commit is contained in:
2023-02-18 19:39:17 +01:00
parent 20843b7018
commit 9ebb7ff075
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);