summaryrefslogtreecommitdiff
path: root/plugingui/listboxbasic.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-02-12 11:07:22 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-02-12 11:07:22 +0100
commitcec1d9ea562e3d52c98f1219db5e186943f2f0d6 (patch)
tree3a66ff06ef16cce96e215644032e6c9fac2cbe8a /plugingui/listboxbasic.cc
parentdc33f15a6b968139779c2b7d2003d3ef6e7d5748 (diff)
Refactor/introduce widget and windiow redraw/dirty mechanism to eradicate unnecessary rendering passes during event handling.
Diffstat (limited to 'plugingui/listboxbasic.cc')
-rw-r--r--plugingui/listboxbasic.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugingui/listboxbasic.cc b/plugingui/listboxbasic.cc
index 730880a..642d03f 100644
--- a/plugingui/listboxbasic.cc
+++ b/plugingui/listboxbasic.cc
@@ -88,7 +88,7 @@ void ListBoxBasic::addItems(const std::vector<ListBoxBasic::Item>& newItems)
int numitems = height() / (font.textHeight() + padding);
scroll.setRange(numitems);
scroll.setMaximum(items.size());
- repaintEvent(nullptr);
+ redraw();
}
void ListBoxBasic::clear()
@@ -97,7 +97,7 @@ void ListBoxBasic::clear()
setSelection(-1);
marked = -1;
scroll.setValue(0);
- repaintEvent(nullptr);
+ redraw();
}
bool ListBoxBasic::selectItem(int index)
@@ -108,7 +108,7 @@ bool ListBoxBasic::selectItem(int index)
}
setSelection(index);
- repaintEvent(nullptr);
+ redraw();
return true;
}
@@ -140,7 +140,7 @@ void ListBoxBasic::clearSelectedValue()
void ListBoxBasic::onScrollBarValueChange(int value)
{
- repaintEvent(nullptr);
+ redraw();
}
void ListBoxBasic::repaintEvent(RepaintEvent* repaintEvent)
@@ -277,7 +277,7 @@ void ListBoxBasic::keyEvent(KeyEvent* keyEvent)
break;
}
- repaintEvent(nullptr);
+ redraw();
}
void ListBoxBasic::buttonEvent(ButtonEvent* buttonEvent)
@@ -329,7 +329,7 @@ void ListBoxBasic::buttonEvent(ButtonEvent* buttonEvent)
}
}
- repaintEvent(nullptr);
+ redraw();
}
if(buttonEvent->direction != Direction::up)
@@ -346,7 +346,7 @@ void ListBoxBasic::buttonEvent(ButtonEvent* buttonEvent)
}
}
- repaintEvent(nullptr);
+ redraw();
}
if(buttonEvent->doubleClick)