diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index fe57855e1..3851a247f 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -259,8 +259,13 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const /* get required height depends of possible lines and max height */ h_hint_obj = min(HINTBOX_MAX_HEIGHT - (ccw_head ? ccw_head->getHeight() : 0), h_lines + 2*w_indentation); - /* add scroll mode if needed */ int txt_mode = text_mode; + /* remove CENTER mode if picon defined */ + if (!Picon.empty() && (txt_mode & CTextBox::CENTER)){ + txt_mode &= ~CTextBox::CENTER; + } + + /* add scroll mode if needed */ if (h_lines > h_hint_obj){ txt_mode = text_mode | CTextBox::SCROLL; ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_TOP | CComponentsHeader::CC_BTN_DOWN; diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index f24fa4b24..641bb6411 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -42,7 +42,7 @@ #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME #define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 -#define DEFAULT_HINTBOX_TEXT_MODE (CTextBox::NO_AUTO_LINEBREAK) +#define DEFAULT_HINTBOX_TEXT_MODE (CTextBox::CENTER) //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. /*!