From ccbab8d4fd2fe36cd8a2ab1ca210e0ac50155ea6 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 3 Nov 2017 09:33:31 -0300 Subject: [PATCH] Avoid continuous redrawing of Home listbox items --- src/app/ui/news_listbox.cpp | 6 +++--- src/app/ui/recent_listbox.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/ui/news_listbox.cpp b/src/app/ui/news_listbox.cpp index dfcf330bc..348720b2c 100644 --- a/src/app/ui/news_listbox.cpp +++ b/src/app/ui/news_listbox.cpp @@ -130,7 +130,7 @@ protected: SkinTheme* theme = static_cast(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); } diff --git a/src/app/ui/recent_listbox.cpp b/src/app/ui/recent_listbox.cpp index 009cdabbd..7c0835444 100644 --- a/src/app/ui/recent_listbox.cpp +++ b/src/app/ui/recent_listbox.cpp @@ -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); } }