From 07b285c5ca3123050e55c78585ab0cbc051ce9e9 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 28 Jan 2010 02:30:59 +0000 Subject: (svn r18932) -Codechange: Don't constantly redraw drop drop list. --- src/widgets/dropdown.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 1056ebced..e32cf4151 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -260,9 +260,16 @@ struct DropdownWindow : Window { virtual void OnTick() { - this->vscroll.UpdatePosition(this->scrolling); - this->scrolling = 0; - this->SetDirty(); + if (this->scrolling != 0) { + int pos = this->vscroll.GetPosition(); + + this->vscroll.UpdatePosition(this->scrolling); + this->scrolling = 0; + + if (pos != this->vscroll.GetPosition()) { + this->SetDirty(); + } + } } virtual void OnMouseLoop() @@ -310,8 +317,10 @@ struct DropdownWindow : Window { if (!this->GetDropDownItem(item)) return; } - this->selected_index = item; - this->SetDirty(); + if (this->selected_index != item) { + this->selected_index = item; + this->SetDirty(); + } } } }; -- cgit v1.2.3-70-g09d2