listframe: add option to control cut of text inside rows, default enabled

This commit is contained in:
2019-05-05 14:14:34 +02:00
parent bdace76186
commit 826986d088
2 changed files with 7 additions and 1 deletions

View File

@@ -175,6 +175,7 @@ void CListFrame::initVar(void)
m_nMode = SCROLL;
m_showSelection = true;
m_cutRowText = NULL;
m_pcFontList = FONT_LIST ;
m_nFontListHeight = m_pcFontList->getHeight();
@@ -505,7 +506,10 @@ void CListFrame::paintRowText(const std::string& text, Font* font, const int& x_
int w_row = dx-OFFSET_INNER_MID;
int h_row = dy-OFFSET_INNER_MIN;
tmp_font = *CNeutrinoFonts::getInstance()->getDynFont(w_row, h_row, text);
if (m_cutRowText)
if (!*m_cutRowText)
tmp_font = *CNeutrinoFonts::getInstance()->getDynFont(w_row, h_row, text);
y_tmp -= (font->getHeight() - tmp_font->getHeight()) >>1 ;
}
tmp_font->RenderString(x_pos, y_tmp, dx, text.c_str(), col);

View File

@@ -116,6 +116,7 @@ class CListFrame
int m_nSelectedLine;
int m_nBgRadius;
int* m_cutRowText;
bool m_showSelection;
@@ -180,6 +181,7 @@ inline int getPages(void) {return(m_nNrOfPages);};
inline void showSelection(bool show) {m_showSelection = show;refreshLine(m_nSelectedLine);};
inline void movePosition(int x, int y){m_cFrame.iX = x; m_cFrame.iY = y;};
inline int getLineHeight() {return m_nFontListHeight;}
inline void cutRowText(int *catRowText) {m_cutRowText = catRowText;}
/* Variables */
typedef enum mode_