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

Origin commit data
------------------
Branch: ni/coolstream
Commit: 580b4980b6
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-05-05 (Sun, 05 May 2019)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2019-05-05 16:00:00 +02:00
committed by vanhofen
parent c7eaad1120
commit 0c52628059
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_