Files
Upsilon/escher/src/bordered.cpp
Émilie Feral 3fa4e0838a [escher] Create a class Bordered instead of BorderedCell: this enable
non-cell view to use it as well
2020-02-12 15:13:21 +01:00

16 lines
911 B
C++

#include <escher/bordered.h>
void Bordered::drawBorderOfRect(KDContext * ctx, KDRect rect, KDColor borderColor) const {
KDCoordinate width = rect.width();
KDCoordinate height = rect.height();
// Draw rectangle around cell
ctx->fillRect(KDRect(0, 0, width, k_separatorThickness), borderColor);
ctx->fillRect(KDRect(0, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), borderColor);
ctx->fillRect(KDRect(width-k_separatorThickness, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), borderColor);
ctx->fillRect(KDRect(0, height-k_separatorThickness, width, k_separatorThickness), borderColor);
}
void Bordered::drawInnerRect(KDContext * ctx, KDRect rect, KDColor backgroundColor) const {
ctx->fillRect(KDRect(k_separatorThickness, k_separatorThickness, rect.width()-2*k_separatorThickness, rect.height()-k_separatorThickness), backgroundColor);
}