summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-02-17 04:45:16 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-02-17 04:45:16 +0100
commit53262d60d7a7afcda0e97f1488fa0457fc959743 (patch)
treed72043b2773fe814e406883df848cf9a0f3ad8a8 /unity-shared
parent6007b97b7a72c9a58efc9d7c1227004d47b99950 (diff)
SearchBar: clear TextEntry geometry before painting it if not in full-redraw
Otherwise we'd get the same texture redrawn over and over, in standalone mode. (bzr r3656.5.2)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/SearchBar.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/unity-shared/SearchBar.cpp b/unity-shared/SearchBar.cpp
index f82cd39dd..58916b5ac 100644
--- a/unity-shared/SearchBar.cpp
+++ b/unity-shared/SearchBar.cpp
@@ -33,7 +33,7 @@
namespace
{
-const float kExpandDefaultIconOpacity = 1.0f;
+const float DEFAULT_ICON_OPACITY = 1.0f;
const int LIVE_SEARCH_TIMEOUT = 40;
const int SPINNER_TIMEOUT = 100;
@@ -199,7 +199,7 @@ void SearchBar::Init()
expand_icon_ = new IconTexture(arrow,
arrow->GetWidth(),
arrow->GetHeight());
- expand_icon_->SetOpacity(kExpandDefaultIconOpacity);
+ expand_icon_->SetOpacity(DEFAULT_ICON_OPACITY);
expand_icon_->SetMinimumSize(arrow->GetWidth(), arrow->GetHeight());
expand_icon_->SetVisible(false);
@@ -428,6 +428,9 @@ void SearchBar::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_dra
nux::GetPainter().PushPaintLayerStack();
}
+ if (!IsFullRedraw())
+ graphics::ClearGeometry(pango_entry_->GetGeometry());
+
layout_->ProcessDraw(graphics_engine, force_draw);
if (IsFullRedraw())
@@ -466,8 +469,7 @@ void SearchBar::SetSearchFinished()
{
start_spinner_timeout_.reset();
- bool is_empty = pango_entry_->im_active() ?
- false : pango_entry_->GetText() == "";
+ bool is_empty = pango_entry_->im_active() ? false : pango_entry_->GetText().empty();
spinner_->SetState(is_empty ? STATE_READY : STATE_CLEAR);
}