Avoid continuous redrawing of Home listbox items

This commit is contained in:
David Capello 2017-11-03 09:33:31 -03:00
parent 83d86cdbc8
commit ccbab8d4fd
2 changed files with 7 additions and 7 deletions

View File

@ -130,7 +130,7 @@ protected:
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
ui::Style* style = theme->styles.newsItem();
setText(m_title);
setTextQuiet(m_title);
gfx::Size sz = theme->calcSizeHint(this, style);
if (!m_desc.empty())
@ -146,7 +146,7 @@ protected:
ui::Style* style = theme->styles.newsItem();
ui::Style* styleDetail = theme->styles.newsItemDetail();
setText(m_title);
setTextQuiet(m_title);
gfx::Size textSize = theme->calcSizeHint(this, style);
gfx::Rect textBounds(bounds.x, bounds.y, bounds.w, textSize.h);
gfx::Rect detailsBounds(
@ -155,7 +155,7 @@ protected:
theme->paintWidget(g, this, style, textBounds);
setText(m_desc);
setTextQuiet(m_desc);
theme->paintWidget(g, this, styleDetail, detailsBounds);
}

View File

@ -57,10 +57,10 @@ protected:
ui::Style* style = theme->styles.recentFile();
ui::Style* styleDetail = theme->styles.recentFileDetail();
setText(m_name);
setTextQuiet(m_name);
gfx::Size sz1 = theme->calcSizeHint(this, style);
setText(m_path);
setTextQuiet(m_path);
gfx::Size sz2 = theme->calcSizeHint(this, styleDetail);
ev.setSizeHint(gfx::Size(sz1.w+sz2.w, MAX(sz1.h, sz2.h)));
@ -73,7 +73,7 @@ protected:
ui::Style* style = theme->styles.recentFile();
ui::Style* styleDetail = theme->styles.recentFileDetail();
setText(m_name.c_str());
setTextQuiet(m_name.c_str());
theme->paintWidget(g, this, style, bounds);
if (Preferences::instance().general.showFullPath()) {
@ -81,7 +81,7 @@ protected:
gfx::Rect detailsBounds(
bounds.x+textSize.w, bounds.y,
bounds.w-textSize.w, bounds.h);
setText(m_path.c_str());
setTextQuiet(m_path.c_str());
theme->paintWidget(g, this, styleDetail, detailsBounds);
}
}