CHintBox: remove center text mode on used picon

This commit is contained in:
2016-11-11 23:10:39 +01:00
parent 3193fef4c6
commit 075917e32d
2 changed files with 7 additions and 2 deletions

View File

@@ -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 */ /* 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); 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; 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){ if (h_lines > h_hint_obj){
txt_mode = text_mode | CTextBox::SCROLL; txt_mode = text_mode | CTextBox::SCROLL;
ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_TOP | CComponentsHeader::CC_BTN_DOWN; ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_TOP | CComponentsHeader::CC_BTN_DOWN;

View File

@@ -42,7 +42,7 @@
#define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME
#define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 #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. //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text.
/*! /*!