hintbox: Add option to enable/disable header for CLoaderHint()

This restores the original intention of showing slim hints while
loading without a header, but keeps the option to enable a header.
This commit is contained in:
2022-11-07 21:21:38 +01:00
parent 806cf7d8b4
commit 602d3835f9
2 changed files with 12 additions and 10 deletions

View File

@@ -492,14 +492,14 @@ CHint::CHint(const neutrino_locale_t Text, bool show_background, const char * co
initHint(show_background); initHint(show_background);
} }
CLoaderHint::CLoaderHint(const char * const Text, bool show_background, const char * const Picon) : CHintBox(LOCALE_MESSAGEBOX_INFO, Text, HINTBOX_MIN_WIDTH, NEUTRINO_ICON_INFO, Picon) CLoaderHint::CLoaderHint(const char * const Text, bool show_background, const char * const Picon, bool enable_header) : CHintBox(LOCALE_MESSAGEBOX_INFO, Text, HINTBOX_MIN_WIDTH, NEUTRINO_ICON_INFO, Picon)
{ {
initHint(show_background); initHint(show_background, enable_header);
} }
CLoaderHint::CLoaderHint(const neutrino_locale_t Text, bool show_background, const char * const Picon) : CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(Text), HINTBOX_MIN_WIDTH, NEUTRINO_ICON_INFO, Picon) CLoaderHint::CLoaderHint(const neutrino_locale_t Text, bool show_background, const char * const Picon, bool enable_header) : CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(Text), HINTBOX_MIN_WIDTH, NEUTRINO_ICON_INFO, Picon)
{ {
initHint(show_background); initHint(show_background, enable_header);
} }
int ShowHintS(const char * const Text, int timeout, bool show_background, const char * const Picon) int ShowHintS(const char * const Text, int timeout, bool show_background, const char * const Picon)

View File

@@ -400,7 +400,7 @@ class CHint : public CHintBox
}; };
}; };
//! Sub class of CHintBox. Shows a simplified hint as a text hint without footer. //! Sub class of CHintBox. Shows a simplified hint as a text hint without footer and optional header.
/*! /*!
CLoaderHint provides a small window with header and text item, CLoaderHint provides a small window with header and text item,
optional disable/enable background, picon and delay optional disable/enable background, picon and delay
@@ -411,10 +411,10 @@ class CLoaderHint : public CHintBox
private: private:
int delay; int delay;
void initHint(bool enable_bg) void initHint(bool enable_bg, bool enable_header)
{ {
paint_bg = enable_bg; paint_bg = enable_bg;
ccw_show_header = true; ccw_show_header = enable_header;
ccw_show_footer = false; ccw_show_footer = false;
cc_item_type.name = "wg.hint"; cc_item_type.name = "wg.hint";
delay = 1; delay = 1;
@@ -426,17 +426,19 @@ class CLoaderHint : public CHintBox
* @param[in] show_background * @param[in] show_background
* @li optional: expects type bool, enable/disable background paint, default = true * @li optional: expects type bool, enable/disable background paint, default = true
* @param[in] Picon * @param[in] Picon
* @li optional: expects type std::string, defines the picon name on the left side of message text, default = NEUTRINO_ICON_LOADER\n * @li optional: expects type std::string, defines the picon name on the left side of message text, default = NEUTRINO_ICON_LOADER
* @param[in] enable_header
* @li optional: expects type bool, enable or disable header for message window, default = false
* @see CHourGlass() * @see CHourGlass()
*/ */
CLoaderHint(const char * const Text, bool show_background = true, const char * const Picon = NEUTRINO_ICON_LOADER); CLoaderHint(const char * const Text, bool show_background = true, const char * const Picon = NEUTRINO_ICON_LOADER, bool enable_header = false);
/**Overloaded localized CLoaderHint Constructor /**Overloaded localized CLoaderHint Constructor
* @param[in] Text * @param[in] Text
* @li expects type neutrino_locale_t, this is the message text inside the window, text is UTF-8 encoded * @li expects type neutrino_locale_t, this is the message text inside the window, text is UTF-8 encoded
* @see for other parameters: CLoaderHint() * @see for other parameters: CLoaderHint()
*/ */
CLoaderHint(const neutrino_locale_t Text, bool show_background = true, const char * const Picon = NEUTRINO_ICON_LOADER); CLoaderHint(const neutrino_locale_t Text, bool show_background = true, const char * const Picon = NEUTRINO_ICON_LOADER, bool enable_header = false);
virtual void setDelay(int d) {delay = d;} virtual void setDelay(int d) {delay = d;}