mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/variable_box_empty_controller] Draw the background
This was not necessary when it was only used for the expressions variable box, because the background was already of the right color thanks to the previous displayed menu. We need to draw it for the python variable box.
This commit is contained in:
@@ -3,13 +3,15 @@
|
||||
#include <apps/i18n.h>
|
||||
#include <assert.h>
|
||||
|
||||
const KDColor VariableBoxEmptyController::VariableBoxEmptyView::k_backgroundColor;
|
||||
|
||||
// VariableBoxEmptyController::VariableBoxEmptyView
|
||||
void VariableBoxEmptyController::VariableBoxEmptyView::initMessageViews() {
|
||||
const int numberOfMessageViews = numberOfMessageTextViews();
|
||||
for (int i = 0; i < numberOfMessageViews; i++) {
|
||||
MessageTextView * message = messageTextViewAtIndex(i);
|
||||
message->setFont(k_font);
|
||||
message->setBackgroundColor(Palette::WallScreen);
|
||||
message->setBackgroundColor(k_backgroundColor);
|
||||
float verticalAlignment = 0.5f;
|
||||
if (i == 0) {
|
||||
verticalAlignment = 1.0f;
|
||||
@@ -28,6 +30,7 @@ void VariableBoxEmptyController::VariableBoxEmptyView::setMessages(I18n::Message
|
||||
}
|
||||
|
||||
void VariableBoxEmptyController::VariableBoxEmptyView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), k_backgroundColor);
|
||||
drawBorderOfRect(ctx, bounds(), Palette::GreyBright);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ protected:
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
private:
|
||||
constexpr static int k_expressionViewRowIndex = 2;
|
||||
constexpr static KDColor k_backgroundColor = Palette::WallScreen;
|
||||
int numberOfSubviews() const override;
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews(bool force = false) override;
|
||||
|
||||
Reference in New Issue
Block a user