[apps/shared] Draw separators between series in Store data

This commit is contained in:
Léa Saviot
2018-05-24 15:12:20 +02:00
parent 70fa8d658e
commit 2717e8ebef
13 changed files with 131 additions and 11 deletions

View File

@@ -0,0 +1,26 @@
#include "store_cell.h"
namespace Shared {
void StoreCell::setSeparatorRight(bool separator) {
if (m_separatorRight != separator) {
m_separatorRight = separator;
reloadCell();
}
}
void StoreCell::drawRect(KDContext * ctx, KDRect rect) const {
HideableEvenOddEditableTextCell::drawRect(ctx, rect);
// Draw the separator
if (m_separatorRight) {
ctx->fillRect(KDRect(bounds().width() - k_separatorThickness, 0, k_separatorThickness, bounds().height()), HideableEvenOddEditableTextCell::hideColor());
}
}
void StoreCell::layoutSubviews() {
KDRect boundsThis = bounds();
editableTextCell()->setFrame(KDRect(boundsThis.topLeft(), boundsThis.width() - k_separatorThickness, boundsThis.height()));
}
}