[apps][escher] Improve colors

Change-Id: I31d3353a5372b63a6c2b3e62c88fb3b5c627e088
This commit is contained in:
Émilie Feral
2017-01-23 18:20:44 +01:00
parent d45000b3d9
commit 0704ab8776
12 changed files with 26 additions and 55 deletions

View File

@@ -1,9 +1,7 @@
#include <escher/header_view_controller.h>
#include <escher/palette.h>
#include <assert.h>
constexpr KDColor HeaderViewController::ContentView::k_separatorHeaderColor;
constexpr KDColor HeaderViewController::ContentView::k_selectedBackgroundColor;
HeaderViewController::ContentView::ContentView(ViewController * mainViewController, HeaderViewDelegate * delegate) :
View(),
m_mainViewController(mainViewController),
@@ -53,9 +51,9 @@ void HeaderViewController::ContentView::layoutSubviews() {
void HeaderViewController::ContentView::drawRect(KDContext * ctx, KDRect rect) const {
if (numberOfButtons() > 0) {
ctx->fillRect(KDRect(0, 0, bounds().width(), k_headerHeight), KDColorWhite);
ctx->fillRect(KDRect(0, k_headerHeight, bounds().width(), 1), k_separatorHeaderColor);
ctx->fillRect(KDRect(0, k_headerHeight, bounds().width(), 1), Palette::GreyWhite);
} else {
ctx->fillRect(KDRect(0, 0, bounds().width(), 1), k_separatorHeaderColor);
ctx->fillRect(KDRect(0, 0, bounds().width(), 1), Palette::GreyWhite);
}
}
@@ -70,7 +68,7 @@ bool HeaderViewController::ContentView::setSelectedButton(int selectedButton, Ap
m_selectedButton = selectedButton;
if (m_selectedButton >= 0) {
Button * button = buttonAtIndex(selectedButton);
button->setBackgroundColor(k_selectedBackgroundColor);
button->setBackgroundColor(Palette::Select);
application->setFirstResponder(button);
return true;
}