Files
Upsilon/apps/settings/cell_with_separator.cpp
Quentin Guidée f1ee3d78ef [WIP] Fix settings
2020-02-16 12:42:08 +01:00

28 lines
697 B
C++

#include "cell_with_separator.h"
namespace Settings {
void CellWithSeparator::setHighlighted(bool highlight) {
cell()->setHighlighted(highlight);
HighlightCell::setHighlighted(highlight);
}
void CellWithSeparator::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(KDRect(0, Metric::CellSeparatorThickness, bounds().width(), k_margin), Palette::BackgroundApps);
}
int CellWithSeparator::numberOfSubviews() const {
return 1;
}
View * CellWithSeparator::subviewAtIndex(int index) {
assert(index == 0);
return cell();
}
void CellWithSeparator::layoutSubviews(bool force) {
cell()->setFrame(KDRect(0, k_margin, bounds().width(), bounds().height()-k_margin), force);
}
}