Files
Upsilon/apps/graph/list/function_expression_view.cpp
Émilie Feral e109a23485 [apps/graph] add methods to handle function names and colors.
Change-Id: Ic11f2dd6bd9cb473b436d5e7769e2660c173c733
2016-10-03 14:04:58 +02:00

18 lines
758 B
C++

#include "function_expression_view.h"
FunctionExpressionView::FunctionExpressionView() :
FunctionCell()
{
}
void FunctionExpressionView::drawRect(KDContext * ctx, KDRect rect) const {
// Select the background color according to the even line and the cursor selection
KDColor background = m_even ? FunctionCell::k_evenLineBackgroundColor : FunctionCell::k_oddLineBackgroundColor;
background = m_highlighted ? FunctionCell::k_selectedLineBackgroundColor : background;
ctx->fillRect(rect, background);
// Select text color according to the state of the function
bool active = m_function->isActive();
KDColor text = active ? KDColorBlack : FunctionCell::k_desactiveTextColor;
m_function->layout()->draw(ctx, KDPointZero, text, background);
}