mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 15:20:39 +01:00
[escher] Create a class Bordered instead of BorderedCell: this enable
non-cell view to use it as well
This commit is contained in:
15
escher/src/bordered.cpp
Normal file
15
escher/src/bordered.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user