mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Separable class
This commit is contained in:
@@ -1,27 +1,22 @@
|
||||
#include "store_cell.h"
|
||||
#include <escher/metric.h>
|
||||
|
||||
namespace Shared {
|
||||
|
||||
void StoreCell::setSeparatorLeft(bool separator) {
|
||||
if (m_separatorLeft != separator) {
|
||||
m_separatorLeft = separator;
|
||||
reloadCell();
|
||||
}
|
||||
}
|
||||
|
||||
void StoreCell::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
HideableEvenOddEditableTextCell::drawRect(ctx, rect);
|
||||
// Draw the separator
|
||||
KDRect separatorRect(0, 0, Metric::TableSeparatorThickness, bounds().height());
|
||||
if (m_separatorLeft) {
|
||||
ctx->fillRect(separatorRect, HideableEvenOddEditableTextCell::hideColor());
|
||||
ctx->fillRect(separatorRect(bounds()), HideableEvenOddEditableTextCell::hideColor());
|
||||
}
|
||||
}
|
||||
|
||||
void StoreCell::layoutSubviews() {
|
||||
KDRect boundsThis = bounds();
|
||||
editableTextCell()->setFrame(KDRect(boundsThis.left() + Metric::TableSeparatorThickness, boundsThis.top(), boundsThis.width() - Metric::TableSeparatorThickness - k_rightMargin, boundsThis.height()));
|
||||
editableTextCell()->setFrame(rectWithoutSeparator(KDRect(boundsThis.left(), boundsThis.top(), boundsThis.width() - k_rightMargin, boundsThis.height())));
|
||||
}
|
||||
|
||||
void StoreCell::didSetSeparator() {
|
||||
reloadCell();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user