From 605dee007b10fbca1a03b0a2b604b4e999ad7c0f Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 26 Apr 2013 14:49:30 +0200 Subject: Don't set value if the value is the same (and save a repaintEvent) --- plugingui/scrollbar.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugingui') diff --git a/plugingui/scrollbar.cc b/plugingui/scrollbar.cc index 3fc3ac8..d48da1a 100644 --- a/plugingui/scrollbar.cc +++ b/plugingui/scrollbar.cc @@ -141,7 +141,9 @@ void GUI::ScrollBar::mouseMoveEvent(MouseMoveEvent *e) int h = height() - 2 * width() - 3; delta /= (float)h / (float)max; - setValue(value_offset - delta); + + int newval = value_offset - delta; + if(newval != value()) setValue(newval); } void GUI::ScrollBar::buttonEvent(ButtonEvent *e) -- cgit v1.2.3