mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/reg] Color the columns titles in Stats
This commit is contained in:
24
apps/regression/column_title_cell.cpp
Normal file
24
apps/regression/column_title_cell.cpp
Normal 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));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user