[apps/reg] Color the columns titles in Stats

This commit is contained in:
Léa Saviot
2018-05-31 17:03:48 +02:00
parent 45b9f9a2f5
commit c0e80a3934
7 changed files with 59 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
#include "column_title_cell.h"
namespace Regression {
void ColumnTitleCell::setColor(KDColor color) {
m_functionColor = color;
m_firstBufferTextView.setTextColor(color);
m_secondBufferTextView.setTextColor(color);
reloadCell();
}
void ColumnTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
EvenOddDoubleBufferTextCellWithSeparator::drawRect(ctx, rect);
ctx->fillRect(KDRect(Metric::TableSeparatorThickness, 0, bounds().width(), k_colorIndicatorThickness), m_functionColor);
}
void ColumnTitleCell::layoutSubviews() {
KDCoordinate width = bounds().width() - Metric::TableSeparatorThickness;
KDCoordinate height = bounds().height();
m_firstBufferTextView.setFrame(KDRect(Metric::TableSeparatorThickness, k_colorIndicatorThickness, width/2, height - k_colorIndicatorThickness));
m_secondBufferTextView.setFrame(KDRect(Metric::TableSeparatorThickness + width/2, k_colorIndicatorThickness, width/2, height - k_colorIndicatorThickness));
}
}