mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/code/varbox] Subtitles and basic items are displayed properly
This commit is contained in:
@@ -13,8 +13,12 @@ public:
|
||||
void setMessage(I18n::Message message);
|
||||
virtual void setTextColor(KDColor color);
|
||||
void setMessageFont(const KDFont * font);
|
||||
void setBackgroundColor(KDColor color);
|
||||
protected:
|
||||
KDColor backgroundColor() const override { return m_backgroundColor; }
|
||||
private:
|
||||
MessageTextView m_messageTextView;
|
||||
KDColor m_backgroundColor;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@ public:
|
||||
virtual View * subAccessoryView() const;
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
protected:
|
||||
virtual KDColor backgroundColor() const { return KDColorWhite; }
|
||||
virtual KDCoordinate labelMargin() const { return Metric::TableCellHorizontalMargin; }
|
||||
virtual KDCoordinate accessoryMargin() const { return Metric::TableCellHorizontalMargin; }
|
||||
int numberOfSubviews() const override;
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
MessageTableCell::MessageTableCell(I18n::Message label, const KDFont * font, Layout layout) :
|
||||
TableCell(layout),
|
||||
m_messageTextView(font, label, 0, 0.5, KDColorBlack, KDColorWhite)
|
||||
m_messageTextView(font, label, 0, 0.5, KDColorBlack, KDColorWhite),
|
||||
m_backgroundColor(KDColorWhite)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -14,7 +15,7 @@ View * MessageTableCell::labelView() const {
|
||||
|
||||
void MessageTableCell::setHighlighted(bool highlight) {
|
||||
HighlightCell::setHighlighted(highlight);
|
||||
KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
|
||||
KDColor backgroundColor = highlight? Palette::Select : m_backgroundColor;
|
||||
m_messageTextView.setBackgroundColor(backgroundColor);
|
||||
}
|
||||
|
||||
@@ -31,3 +32,8 @@ void MessageTableCell::setMessageFont(const KDFont * font) {
|
||||
m_messageTextView.setFont(font);
|
||||
layoutSubviews();
|
||||
}
|
||||
|
||||
void MessageTableCell::setBackgroundColor(KDColor color) {
|
||||
m_backgroundColor = color;
|
||||
m_messageTextView.setBackgroundColor(color);
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ void TableCell::layoutSubviews(bool force) {
|
||||
}
|
||||
|
||||
void TableCell::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite;
|
||||
drawInnerRect(ctx, bounds(), backgroundColor);
|
||||
KDColor backColor = isHighlighted() ? Palette::Select : backgroundColor();
|
||||
drawInnerRect(ctx, bounds(), backColor);
|
||||
drawBorderOfRect(ctx, bounds(), Palette::GreyBright);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user