mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
CTextBox: expand parameters of member setTextBorderWidth()
This allows to use different horizontal and vertical width of borders in text boxes. Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -140,7 +140,7 @@ void CComponentsFrmClock::initCCLockItems()
|
||||
lbl->setCornerType(corner_type);
|
||||
|
||||
//set text border to 0
|
||||
lbl->setTextBorderWidth(0);
|
||||
lbl->setTextBorderWidth(0,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -99,7 +99,8 @@ void CComponentsText::initVarText()
|
||||
/* we need a minimal borderwith of 1px because the edge-smoothing
|
||||
(or fontrenderer?) otherwise will paint single pixels outside the
|
||||
defined area. e.g. 'j' is leaving such residues */
|
||||
ct_text_border = 1;
|
||||
ct_text_Hborder = 1;
|
||||
ct_text_Vborder = 0;
|
||||
|
||||
ct_col_text = COL_MENUCONTENT;
|
||||
ct_text_sent = false;
|
||||
@@ -144,7 +145,7 @@ void CComponentsText::initCCText()
|
||||
ct_textbox->setTextFont(ct_font);
|
||||
ct_textbox->setTextMode(ct_text_mode);
|
||||
ct_textbox->setWindowPos(ct_box);
|
||||
ct_textbox->setTextBorderWidth(ct_text_border);
|
||||
ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder);
|
||||
ct_textbox->enableBackgroundPaint(ct_paint_textbg);
|
||||
ct_textbox->setBackGroundColor(col_body);
|
||||
ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type);
|
||||
|
@@ -52,8 +52,10 @@ class CComponentsText : public CComponentsItem
|
||||
fb_pixel_t ct_col_text;
|
||||
///property: text display modes, see textbox.h for possible modes
|
||||
int ct_text_mode;
|
||||
///property: text border width
|
||||
int ct_text_border;
|
||||
///property: horizontal text border width (left and right)
|
||||
int ct_text_Hborder;
|
||||
///property: vertical text border width (top and buttom)
|
||||
int ct_text_Vborder;
|
||||
///property: current text string
|
||||
std::string ct_text;
|
||||
///status: cached text string, mainly required to compare with current text
|
||||
@@ -101,7 +103,7 @@ class CComponentsText : public CComponentsItem
|
||||
///set text alignment, also see textbox.h for possible alignment modes
|
||||
virtual inline void setTextMode(const int mode){ct_text_mode = mode;};
|
||||
///set text border width
|
||||
virtual inline void setTextBorderWidth(const int border){ct_text_border = border;};
|
||||
virtual inline void setTextBorderWidth(const int Hborder, const int Vborder = 0){ct_text_Hborder = Hborder; ct_text_Vborder = Vborder;};
|
||||
|
||||
///send option to CTextBox object to paint background box behind text or not
|
||||
virtual inline void doPaintTextBoxBg(bool do_paintbox_bg){ ct_paint_textbg = do_paintbox_bg;};
|
||||
|
@@ -295,7 +295,7 @@ void CComponentsItemBox::paintText(size_t index, bool newElement)
|
||||
v_element_data[index].handler2 = (void*)textbox;
|
||||
}
|
||||
|
||||
textbox->setTextBorderWidth(0);
|
||||
textbox->setTextBorderWidth(0,0);
|
||||
textbox->enableBackgroundPaint(false);
|
||||
textbox->setTextFont(font_text);
|
||||
textbox->movePosition(box->iX, box->iY);
|
||||
|
Reference in New Issue
Block a user