mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/settings] Create a parent class CellWithSeparator to
MessageTableCellWithEditableTextWithSeparator for future factorization
This commit is contained in:
30
apps/settings/cell_with_separator.cpp
Normal file
30
apps/settings/cell_with_separator.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#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, 0, bounds().width(), k_separatorThickness), Palette::GreyBright);
|
||||
KDCoordinate height = bounds().height();
|
||||
ctx->fillRect(KDRect(0, m_separatorBelow ? height - k_margin : Metric::CellSeparatorThickness, bounds().width(), k_margin), Palette::WallScreen);
|
||||
}
|
||||
|
||||
int CellWithSeparator::numberOfSubviews() const {
|
||||
return 1;
|
||||
}
|
||||
|
||||
View * CellWithSeparator::subviewAtIndex(int index) {
|
||||
assert(index == 0);
|
||||
return cell();
|
||||
}
|
||||
|
||||
void CellWithSeparator::layoutSubviews(bool force) {
|
||||
KDRect frame = KDRect(0, m_separatorBelow ? 0 : k_margin, bounds().width(), bounds().height()-k_margin);
|
||||
cell()->setFrame(frame, force);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user