[apps/regression] even_odd_double_buffer_text_cell_with_separator:

simplify selectFirstText code
This commit is contained in:
Émilie Feral
2019-09-23 16:46:06 +02:00
committed by LeaNumworks
parent 2c84bb1031
commit 38eaf9b051

View File

@@ -36,8 +36,7 @@ bool EvenOddDoubleBufferTextCellWithSeparator::firstTextSelected() {
void EvenOddDoubleBufferTextCellWithSeparator::selectFirstText(bool selectFirstText) {
m_firstTextSelected = selectFirstText;
m_firstBufferTextView.setHighlighted(selectFirstText);
m_secondBufferTextView.setHighlighted(!selectFirstText);
setHighlighted(isHighlighted());
}
void EvenOddDoubleBufferTextCellWithSeparator::reloadCell() {
@@ -46,16 +45,9 @@ void EvenOddDoubleBufferTextCellWithSeparator::reloadCell() {
}
void EvenOddDoubleBufferTextCellWithSeparator::setHighlighted(bool highlight) {
m_firstBufferTextView.setHighlighted(false);
m_secondBufferTextView.setHighlighted(false);
HighlightCell::setHighlighted(highlight);
if (isHighlighted()) {
if (m_firstTextSelected) {
m_firstBufferTextView.setHighlighted(true);
} else {
m_secondBufferTextView.setHighlighted(true);
}
}
m_firstBufferTextView.setHighlighted(highlight && m_firstTextSelected);
m_secondBufferTextView.setHighlighted(highlight && !m_firstTextSelected);
}
void EvenOddDoubleBufferTextCellWithSeparator::setEven(bool even) {