[apps] Avoid useless blinking in row button view

Change-Id: Ib4cba9a4c08b66fcbd26c6afd183c670ee670944
This commit is contained in:
Émilie Feral
2017-04-13 18:16:54 +02:00
parent cdb9e273aa
commit c9ec9e0a4c

View File

@@ -49,10 +49,15 @@ int ButtonRowController::ContentView::numberOfSubviews() const {
}
View * ButtonRowController::ContentView::subviewAtIndex(int index) {
if (index == 0) {
/* Warning: the order of the subviews is important for drity tracking.
* Indeed, when a child is redrawn, the redrawn area is the smallest
* rectangle unioniong the dirty rectangle and the previous redrawn area.
* As the main view is more likely to be bigger, we prefer to set it as the
* last child. */
if (index == numberOfSubviews() - 1) {
return m_mainViewController->view();
} else {
return buttonAtIndex(index - 1);
return buttonAtIndex(index);
}
}