[escher] Change the function expression cell to inherit from

even odd expression cell
This commit is contained in:
Émilie Feral
2018-05-22 16:30:38 +02:00
parent c0d3b97c6b
commit e160282e06
14 changed files with 71 additions and 104 deletions

View File

@@ -17,12 +17,14 @@ void FunctionTitleCell::setColor(KDColor color) {
void FunctionTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
if (m_orientation == Orientation::VerticalIndicator){
ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), m_functionColor);
// Color the vertical separator
ctx->fillRect(KDRect(bounds().width()-k_separatorThickness, 0, k_separatorThickness, bounds().height()), Palette::GreyBright);
KDColor separatorColor = m_even ? Palette::WallScreen : KDColorWhite;
// Color the horizontal separator
ctx->fillRect(KDRect(k_colorIndicatorThickness, bounds().height()-k_separatorThickness, bounds().width()-k_colorIndicatorThickness-k_separatorThickness, k_separatorThickness), separatorColor);
} else {
ctx->fillRect(KDRect(0, 0, bounds().width(), k_colorIndicatorThickness), m_functionColor);
}
KDColor separatorColor = m_even ? Palette::WallScreen : KDColorWhite;
// Color the horizontal separator
ctx->fillRect(KDRect(k_colorIndicatorThickness, bounds().height()-k_separatorThickness, bounds().width()-k_colorIndicatorThickness, k_separatorThickness), separatorColor);
}
}