[apps/graph] add an attribute "activate" to functions

Change-Id: I1a1f548c540a6e31fe9ce1aeb742bf6a6292362c
This commit is contained in:
Émilie Feral
2016-09-19 15:22:24 +02:00
parent 8a27740719
commit 1f7ba888c9
4 changed files with 17 additions and 4 deletions

View File

@@ -13,7 +13,8 @@ void FunctionExpressionView::drawRect(KDContext * ctx, KDRect rect) const {
bool evenLine = isEven();
KDColor background = evenLine ? KDColor(0xEEEEEE) : KDColor(0x777777);
ctx->fillRect(rect, background);
KDColor text = m_focused ? KDColorBlack : KDColorWhite;
bool active = function()->isActive();
KDColor text = active ? KDColorGreen : KDColorRed;
KDColor textBackground = m_focused ? KDColorWhite : KDColorBlack;
Graph::Function * function = FunctionExpressionView::function();
@@ -21,7 +22,6 @@ void FunctionExpressionView::drawRect(KDContext * ctx, KDRect rect) const {
// m_function->layout()->draw(ctx, KDPointZero);
}
void FunctionExpressionView::didBecomeFirstResponder() {
m_focused = true;
markRectAsDirty(bounds());