mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
#include "function_title_cell.h"
|
|
#include <assert.h>
|
|
|
|
namespace Shared {
|
|
|
|
void FunctionTitleCell::setOrientation(Orientation orientation) {
|
|
m_orientation = orientation;
|
|
reloadCell();
|
|
}
|
|
|
|
void FunctionTitleCell::setColor(KDColor color) {
|
|
m_functionColor = color;
|
|
reloadCell();
|
|
}
|
|
|
|
void FunctionTitleCell::setBaseline(KDCoordinate baseline) {
|
|
if (m_baseline != baseline) {
|
|
m_baseline = baseline;
|
|
reloadCell();
|
|
}
|
|
}
|
|
|
|
void FunctionTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
|
|
if (m_orientation == Orientation::VerticalIndicator){
|
|
ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), 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);
|
|
} else {
|
|
ctx->fillRect(KDRect(0, 0, bounds().width(), k_colorIndicatorThickness), m_functionColor);
|
|
}
|
|
}
|
|
|
|
}
|