From d45000b3d9aab66b6a5feea77f56cff538bcecf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 23 Jan 2017 17:58:11 +0100 Subject: [PATCH] [escher] In palette, improve colors Change-Id: I2c8f33764cf2befeb994b9b47b46d39f116ae96c --- apps/calculation/history_view_cell.cpp | 4 +- apps/graph/list/function_expression_view.cpp | 2 +- apps/graph/list/list_controller.cpp | 2 +- apps/node_navigation_controller.cpp | 2 +- apps/probability/cell.cpp | 12 ++-- apps/probability/parameters_controller.cpp | 8 +-- apps/range_parameter_controller.cpp | 2 +- apps/regression/calculation_controller.cpp | 4 +- apps/statistics/calculation_controller.cpp | 2 +- apps/toolbox_leaf_cell.cpp | 14 ++--- apps/variable_box_controller.cpp | 2 +- apps/variable_box_leaf_cell.cpp | 14 ++--- escher/include/escher/palette.h | 18 ++++-- escher/include/escher/scroll_view.h | 2 +- escher/include/escher/selectable_table_view.h | 2 +- escher/include/escher/stack_view_controller.h | 2 +- escher/include/escher/table_view.h | 2 +- .../src/alternate_empty_view_controller.cpp | 2 +- escher/src/chevron_view.cpp | 56 +++++++++---------- escher/src/editable_text_cell.cpp | 2 +- escher/src/editable_text_menu_list_cell.cpp | 2 +- escher/src/menu_list_cell.cpp | 12 ++-- escher/src/palette.cpp | 18 ++++-- escher/src/scroll_view.cpp | 2 +- escher/src/switch_view.cpp | 17 +++--- escher/src/text_menu_list_cell.cpp | 4 +- 26 files changed, 111 insertions(+), 98 deletions(-) diff --git a/apps/calculation/history_view_cell.cpp b/apps/calculation/history_view_cell.cpp index 6282961cc..ea60010df 100644 --- a/apps/calculation/history_view_cell.cpp +++ b/apps/calculation/history_view_cell.cpp @@ -56,9 +56,9 @@ void HistoryViewCell::reloadCell() { m_inputView.setBackgroundColor(backgroundColor()); if (isHighlighted()) { if (m_selectedSubviewType == SubviewType::Output) { - m_outputView.setBackgroundColor(Palette::FocusCellBackgroundColor); + m_outputView.setBackgroundColor(Palette::Select); } else { - m_inputView.setBackgroundColor(Palette::FocusCellBackgroundColor); + m_inputView.setBackgroundColor(Palette::Select); } } layoutSubviews(); diff --git a/apps/graph/list/function_expression_view.cpp b/apps/graph/list/function_expression_view.cpp index aab6de58c..3dca2d18c 100644 --- a/apps/graph/list/function_expression_view.cpp +++ b/apps/graph/list/function_expression_view.cpp @@ -22,7 +22,7 @@ void FunctionExpressionView::reloadCell() { m_expressionView.setBackgroundColor(backgroundColor()); if (m_function) { bool active = m_function->isActive(); - KDColor textColor = active ? KDColorBlack : Palette::DesactiveTextColor; + KDColor textColor = active ? KDColorBlack : Palette::GreyDark; m_expressionView.setTextColor(textColor); } } diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp index 11100d914..e1d39afeb 100644 --- a/apps/graph/list/list_controller.cpp +++ b/apps/graph/list/list_controller.cpp @@ -233,7 +233,7 @@ void ListController::willDisplayCellAtLocation(TableViewCell * cell, int i, int Function * function = m_functionStore->functionAtIndex(j); char bufferName[5] = {*function->name(),'(','x',')', 0}; myFunctionCell->setText(bufferName); - KDColor functionNameColor = function->isActive() ? function->color() : Palette::DesactiveTextColor; + KDColor functionNameColor = function->isActive() ? function->color() : Palette::GreyDark; myFunctionCell->setColor(functionNameColor); } else { FunctionExpressionView * myCell = (FunctionExpressionView *)cell; diff --git a/apps/node_navigation_controller.cpp b/apps/node_navigation_controller.cpp index 0b08f38f4..086f09729 100644 --- a/apps/node_navigation_controller.cpp +++ b/apps/node_navigation_controller.cpp @@ -65,7 +65,7 @@ void NodeNavigationController::Stack::resetStack() { /* NodeNavigationController */ NodeNavigationController::NodeNavigationController() : - StackViewController(nullptr, &m_listViewController, true, KDColorWhite, Palette::BoxTitleBackgroundColor, Palette::BoxTitleBackgroundColor), + StackViewController(nullptr, &m_listViewController, true, KDColorWhite, Palette::PurpleBright, Palette::PurpleDark), m_listViewController(NodeListViewController(this)) { } diff --git a/apps/probability/cell.cpp b/apps/probability/cell.cpp index 44d7ae3c6..a891a729d 100644 --- a/apps/probability/cell.cpp +++ b/apps/probability/cell.cpp @@ -5,7 +5,7 @@ namespace Probability { Cell::Cell() : TableViewCell(), - m_labelView(PointerTextView(KDText::FontSize::Large, nullptr, 0, 0.5, KDColorBlack, Palette::CellBackgroundColor)) + m_labelView(PointerTextView(KDText::FontSize::Large, nullptr, 0, 0.5, KDColorBlack, KDColorWhite)) { } @@ -34,7 +34,7 @@ void Cell::layoutSubviews() { void Cell::reloadCell() { TableViewCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; m_labelView.setBackgroundColor(backgroundColor); m_chevronView.setHighlighted(isHighlighted()); if (isHighlighted()) { @@ -56,11 +56,11 @@ void Cell::setImage(const Image * image, const Image * focusedImage) { void Cell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - KDColor backgroundColor = isHighlighted() ? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite; ctx->fillRect(KDRect(1, 1, width-2, height-1), backgroundColor); - ctx->fillRect(KDRect(0, 0, width, 1), Palette::LineColor); - ctx->fillRect(KDRect(0, 1, 1, height-1), Palette::LineColor); - ctx->fillRect(KDRect(width-1, 1, 1, height-1), Palette::LineColor); + ctx->fillRect(KDRect(0, 0, width, 1), Palette::GreyBright); + ctx->fillRect(KDRect(0, 1, 1, height-1), Palette::GreyBright); + ctx->fillRect(KDRect(width-1, 1, 1, height-1), Palette::GreyBright); } } diff --git a/apps/probability/parameters_controller.cpp b/apps/probability/parameters_controller.cpp index c9c7af318..e10edb319 100644 --- a/apps/probability/parameters_controller.cpp +++ b/apps/probability/parameters_controller.cpp @@ -17,8 +17,8 @@ ParametersController::ContentView::ContentView(Responder * parentResponder, Sele stack->updateTitle(); stack->push(calculationController); }, parentResponder), KDText::FontSize::Large)), - m_firstParameterDefinition(PointerTextView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorBlack, Palette::BackgroundColor)), - m_secondParameterDefinition(PointerTextView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorBlack, Palette::BackgroundColor)), + m_firstParameterDefinition(PointerTextView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorBlack, Palette::WallScreen)), + m_secondParameterDefinition(PointerTextView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorBlack, Palette::WallScreen)), m_selectableTableView(selectableTableView) { } @@ -37,7 +37,7 @@ PointerTextView * ParametersController::ContentView::parameterDefinitionAtIndex( void ParametersController::ContentView::drawRect(KDContext * ctx, KDRect rect) const { int tableHeight = m_selectableTableView->size().height()+ Metric::TopMargin + Metric::BottomMargin; - ctx->fillRect(KDRect(0, tableHeight, bounds().width(), bounds().height() - tableHeight), Palette::BackgroundColor); + ctx->fillRect(KDRect(0, tableHeight, bounds().width(), bounds().height() - tableHeight), Palette::WallScreen); } int ParametersController::ContentView::numberOfSubviews() const { @@ -113,7 +113,7 @@ void ParametersController::updateTitle() { bool ParametersController::handleEvent(Ion::Events::Event event) { if (event == Ion::Events::Down && !m_buttonSelected) { m_buttonSelected = true; - m_contentView.button()->setBackgroundColor(Palette::FocusCellBackgroundColor); + m_contentView.button()->setBackgroundColor(Palette::Select); m_selectableTableView.deselectTable(); app()->setFirstResponder(m_contentView.button()); updateTitle(); diff --git a/apps/range_parameter_controller.cpp b/apps/range_parameter_controller.cpp index 6ebb964ee..a09befe5b 100644 --- a/apps/range_parameter_controller.cpp +++ b/apps/range_parameter_controller.cpp @@ -23,7 +23,7 @@ void RangeParameterController::willDisplayCellForIndex(TableViewCell * cell, int } if (index == 3 || index == 4) { if (m_interactiveRange->yAuto()) { - m_rangeCells[index-1].setTextColor(Palette::DesactiveTextColor); + m_rangeCells[index-1].setTextColor(Palette::GreyDark); } else { m_rangeCells[index-1].setTextColor(KDColorBlack); } diff --git a/apps/regression/calculation_controller.cpp b/apps/regression/calculation_controller.cpp index 09e7d7805..fb2243b3a 100644 --- a/apps/regression/calculation_controller.cpp +++ b/apps/regression/calculation_controller.cpp @@ -16,8 +16,8 @@ CalculationController::CalculationController(Responder * parentResponder, Header m_store(store) { for (int k = 0; k < k_maxNumberOfDisplayableRows/2; k++) { - m_calculationCells[k].setTextColor(Palette::DesactiveTextColor); - m_doubleCalculationCells[k].setTextColor(Palette::DesactiveTextColor); + m_calculationCells[k].setTextColor(Palette::GreyDark); + m_doubleCalculationCells[k].setTextColor(Palette::GreyDark); m_doubleCalculationCells[k].setParentResponder(&m_selectableTableView); } } diff --git a/apps/statistics/calculation_controller.cpp b/apps/statistics/calculation_controller.cpp index a540351df..9d558bafb 100644 --- a/apps/statistics/calculation_controller.cpp +++ b/apps/statistics/calculation_controller.cpp @@ -17,7 +17,7 @@ CalculationController::CalculationController(Responder * parentResponder, Header { for (int k = 0; k < k_maxNumberOfDisplayableRows; k++) { m_titleCells[k].setAlignment(1.0f, 0.5f); - m_calculationCells[k].setTextColor(Palette::DesactiveTextColor); + m_calculationCells[k].setTextColor(Palette::GreyDark); } } diff --git a/apps/toolbox_leaf_cell.cpp b/apps/toolbox_leaf_cell.cpp index 13708f428..ae9705b56 100644 --- a/apps/toolbox_leaf_cell.cpp +++ b/apps/toolbox_leaf_cell.cpp @@ -3,8 +3,8 @@ ToolboxLeafCell::ToolboxLeafCell() : TableViewCell(), - m_labelView(PointerTextView(KDText::FontSize::Small, nullptr, 0, 0.5, KDColorBlack, Palette::CellBackgroundColor)), - m_subtitleView(PointerTextView(KDText::FontSize::Small, nullptr, 0, 0.5, Palette::DesactiveTextColor, Palette::CellBackgroundColor)) + m_labelView(PointerTextView(KDText::FontSize::Small, nullptr, 0, 0.5, KDColorBlack, KDColorWhite)), + m_subtitleView(PointerTextView(KDText::FontSize::Small, nullptr, 0, 0.5, Palette::GreyDark, KDColorWhite)) { } @@ -29,7 +29,7 @@ void ToolboxLeafCell::layoutSubviews() { void ToolboxLeafCell::reloadCell() { TableViewCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; m_labelView.setBackgroundColor(backgroundColor); m_subtitleView.setBackgroundColor(backgroundColor); } @@ -45,9 +45,9 @@ void ToolboxLeafCell::setSubtitle(const char * text) { void ToolboxLeafCell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - KDColor backgroundColor = isHighlighted() ? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite; ctx->fillRect(KDRect(1, 0, width-2, height-1), backgroundColor); - ctx->fillRect(KDRect(0, height-1, width, 1), Palette::LineColor); - ctx->fillRect(KDRect(0, 0, 1, height-1), Palette::LineColor); - ctx->fillRect(KDRect(width-1, 0, 1, height-1), Palette::LineColor); + ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GreyBright); + ctx->fillRect(KDRect(0, 0, 1, height-1), Palette::GreyBright); + ctx->fillRect(KDRect(width-1, 0, 1, height-1), Palette::GreyBright); } diff --git a/apps/variable_box_controller.cpp b/apps/variable_box_controller.cpp index 5a77a8825..21a0ac368 100644 --- a/apps/variable_box_controller.cpp +++ b/apps/variable_box_controller.cpp @@ -218,7 +218,7 @@ void VariableBoxController::ContentViewController::setTextFieldCaller(TextField } VariableBoxController::VariableBoxController(Context * context) : - StackViewController(nullptr, &m_contentViewController, true, KDColorWhite, Palette::BoxTitleBackgroundColor, Palette::BoxTitleBackgroundColor), + StackViewController(nullptr, &m_contentViewController, true, KDColorWhite, Palette::PurpleBright, Palette::PurpleDark), m_contentViewController(ContentViewController(this, context)) { } diff --git a/apps/variable_box_leaf_cell.cpp b/apps/variable_box_leaf_cell.cpp index 380ae0189..9e511b298 100644 --- a/apps/variable_box_leaf_cell.cpp +++ b/apps/variable_box_leaf_cell.cpp @@ -3,8 +3,8 @@ VariableBoxLeafCell::VariableBoxLeafCell() : TableViewCell(), - m_labelView(BufferTextView(KDText::FontSize::Small, 0, 0.5, KDColorBlack, Palette::CellBackgroundColor)), - m_subtitleView(BufferTextView(KDText::FontSize::Small, 0, 0.5, Palette::DesactiveTextColor, Palette::CellBackgroundColor)), + m_labelView(BufferTextView(KDText::FontSize::Small, 0, 0.5, KDColorBlack, KDColorWhite)), + m_subtitleView(BufferTextView(KDText::FontSize::Small, 0, 0.5, Palette::GreyDark, KDColorWhite)), m_displayExpression(false) { } @@ -49,7 +49,7 @@ void VariableBoxLeafCell::layoutSubviews() { void VariableBoxLeafCell::reloadCell() { TableViewCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; m_labelView.setBackgroundColor(backgroundColor); m_subtitleView.setBackgroundColor(backgroundColor); m_expressionView.setBackgroundColor(backgroundColor); @@ -71,9 +71,9 @@ void VariableBoxLeafCell::setExpression(ExpressionLayout * expressionLayout) { void VariableBoxLeafCell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - KDColor backgroundColor = isHighlighted() ? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite; ctx->fillRect(KDRect(1, 0, width-2, height-1), backgroundColor); - ctx->fillRect(KDRect(0, height-1, width, 1), Palette::LineColor); - ctx->fillRect(KDRect(0, 0, 1, height-1), Palette::LineColor); - ctx->fillRect(KDRect(width-1, 0, 1, height-1), Palette::LineColor); + ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GreyBright); + ctx->fillRect(KDRect(0, 0, 1, height-1), Palette::GreyBright); + ctx->fillRect(KDRect(width-1, 0, 1, height-1), Palette::GreyBright); } diff --git a/escher/include/escher/palette.h b/escher/include/escher/palette.h index 6c52d793e..76c1ba45d 100644 --- a/escher/include/escher/palette.h +++ b/escher/include/escher/palette.h @@ -5,12 +5,18 @@ class Palette { public: - constexpr static KDColor LineColor = KDColor::RGB24(0xB4B7B9); - constexpr static KDColor BackgroundColor = KDColor::RGB24(0xF0F3F5); - constexpr static KDColor CellBackgroundColor = KDColor::RGB24(0xFCFCFC); - constexpr static KDColor FocusCellBackgroundColor = KDColor::RGB24(0xDDDFE6); - constexpr static KDColor DesactiveTextColor = KDColor::RGB24(0x646464); - constexpr static KDColor BoxTitleBackgroundColor = KDColor::RGB24(0x656976); + constexpr static KDColor YellowOne = KDColor::RGB24(0xffb734); + constexpr static KDColor YellowTwo = KDColor::RGB24(0xffcc7b); + constexpr static KDColor PurpleBright = KDColor::RGB24(0x656975); + constexpr static KDColor PurpleDark = KDColor::RGB24(0x414147); + constexpr static KDColor GreyWhite = KDColor::RGB24(0xf5f5f5); + constexpr static KDColor GreyBright = KDColor::RGB24(0xececec); + constexpr static KDColor GreyMiddle = KDColor::RGB24(0xd9d9d9); + constexpr static KDColor GreyDark = KDColor::RGB24(0xa7a7a7); + constexpr static KDColor Select = KDColor::RGB24(0xd4d7e0); + constexpr static KDColor WallScreen = KDColor::RGB24(0xf7f9fa); + constexpr static KDColor SubTab = KDColor::RGB24(0xb8bbc5); + constexpr static KDColor LowBattery = KDColor::RGB24(0xf30211); }; #endif diff --git a/escher/include/escher/scroll_view.h b/escher/include/escher/scroll_view.h index 362bbf692..9c424458d 100644 --- a/escher/include/escher/scroll_view.h +++ b/escher/include/escher/scroll_view.h @@ -9,7 +9,7 @@ class ScrollView : public View { public: ScrollView(View * contentView, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, bool showIndicators = true, - bool colorBackground = true, KDColor backgroundColor = Palette::BackgroundColor); + bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen); void setContentOffset(KDPoint offset); KDPoint contentOffset(); diff --git a/escher/include/escher/selectable_table_view.h b/escher/include/escher/selectable_table_view.h index e596651f6..dfdfbd938 100644 --- a/escher/include/escher/selectable_table_view.h +++ b/escher/include/escher/selectable_table_view.h @@ -19,7 +19,7 @@ public: SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, SelectableTableViewDelegate * delegate = nullptr, - bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::BackgroundColor); + bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen); int selectedRow(); int selectedColumn(); virtual bool handleEvent(Ion::Events::Event event) override; diff --git a/escher/include/escher/stack_view_controller.h b/escher/include/escher/stack_view_controller.h index 9a899751b..0d1ac4b31 100644 --- a/escher/include/escher/stack_view_controller.h +++ b/escher/include/escher/stack_view_controller.h @@ -10,7 +10,7 @@ constexpr uint8_t kMaxNumberOfStacks = 4; class StackViewController : public ViewController { public: StackViewController(Responder * parentResponder, ViewController * rootViewController, bool displayFirstStackHeader = false, - KDColor textColor = Palette::DesactiveTextColor, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::LineColor); + KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GreyBright); /* Push creates a new StackView and adds it */ void push(ViewController * vc); diff --git a/escher/include/escher/table_view.h b/escher/include/escher/table_view.h index c36aff748..8b5b55fdd 100644 --- a/escher/include/escher/table_view.h +++ b/escher/include/escher/table_view.h @@ -10,7 +10,7 @@ class TableView : public ScrollView { public: TableView(TableViewDataSource * dataSource, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, - bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::BackgroundColor); + bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen); virtual void scrollToCell(int i, int j); TableViewCell * cellAtLocation(int i, int j); diff --git a/escher/src/alternate_empty_view_controller.cpp b/escher/src/alternate_empty_view_controller.cpp index 4193ef075..95f3f970b 100644 --- a/escher/src/alternate_empty_view_controller.cpp +++ b/escher/src/alternate_empty_view_controller.cpp @@ -6,7 +6,7 @@ /* ContentView */ AlternateEmptyViewController::ContentView::ContentView(ViewController * mainViewController, AlternateEmptyViewDelegate * delegate) : - m_message(PointerTextView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorBlack, Palette::BackgroundColor)), + m_message(PointerTextView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorBlack, Palette::WallScreen)), m_mainViewController(mainViewController), m_delegate(delegate) { diff --git a/escher/src/chevron_view.cpp b/escher/src/chevron_view.cpp index 8b03e3870..2b68eba39 100644 --- a/escher/src/chevron_view.cpp +++ b/escher/src/chevron_view.cpp @@ -2,41 +2,41 @@ #include const KDColor chevronPixel[] = { - KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, + KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, - KDColorBlack, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, Palette::CellBackgroundColor, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, + KDColorBlack, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, KDColorWhite, }; const KDColor highlightedChevronPixel[] = { - KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, + KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, - KDColorBlack, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, Palette::FocusCellBackgroundColor, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, + KDColorBlack, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, Palette::Select, }; ChevronView::ChevronView() : diff --git a/escher/src/editable_text_cell.cpp b/escher/src/editable_text_cell.cpp index d672b9396..b7f64d1c1 100644 --- a/escher/src/editable_text_cell.cpp +++ b/escher/src/editable_text_cell.cpp @@ -17,7 +17,7 @@ TextField * EditableTextCell::textField() { void EditableTextCell::reloadCell() { TableViewCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; m_textField.setBackgroundColor(backgroundColor); } diff --git a/escher/src/editable_text_menu_list_cell.cpp b/escher/src/editable_text_menu_list_cell.cpp index 95967a194..5a1b9e8a8 100644 --- a/escher/src/editable_text_menu_list_cell.cpp +++ b/escher/src/editable_text_menu_list_cell.cpp @@ -35,7 +35,7 @@ void EditableTextMenuListCell::setEditing(bool isEditing) { void EditableTextMenuListCell::reloadCell() { MenuListCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; m_textField.setBackgroundColor(backgroundColor); } diff --git a/escher/src/menu_list_cell.cpp b/escher/src/menu_list_cell.cpp index 07c3e7ae4..a6c576930 100644 --- a/escher/src/menu_list_cell.cpp +++ b/escher/src/menu_list_cell.cpp @@ -5,7 +5,7 @@ constexpr KDCoordinate MenuListCell::k_separatorThickness; MenuListCell::MenuListCell(char * label) : TableViewCell(), - m_pointerTextView(PointerTextView(KDText::FontSize::Small, label, 0, 0.5, KDColorBlack, Palette::CellBackgroundColor)) + m_pointerTextView(PointerTextView(KDText::FontSize::Small, label, 0, 0.5, KDColorBlack, KDColorWhite)) { } @@ -37,7 +37,7 @@ void MenuListCell::layoutSubviews() { void MenuListCell::reloadCell() { TableViewCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; m_pointerTextView.setBackgroundColor(backgroundColor); } @@ -57,10 +57,10 @@ View * MenuListCell::accessoryView() const { void MenuListCell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - KDColor backgroundColor = isHighlighted() ? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite; ctx->fillRect(KDRect(k_separatorThickness, k_separatorThickness, width-2*k_separatorThickness, height-k_separatorThickness), backgroundColor); - ctx->fillRect(KDRect(0, 0, width, k_separatorThickness), Palette::LineColor); - ctx->fillRect(KDRect(0, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::LineColor); - ctx->fillRect(KDRect(width-k_separatorThickness, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::LineColor); + ctx->fillRect(KDRect(0, 0, width, k_separatorThickness), Palette::GreyBright); + ctx->fillRect(KDRect(0, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::GreyBright); + ctx->fillRect(KDRect(width-k_separatorThickness, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::GreyBright); } diff --git a/escher/src/palette.cpp b/escher/src/palette.cpp index 56e3c6868..7bbbde992 100644 --- a/escher/src/palette.cpp +++ b/escher/src/palette.cpp @@ -1,8 +1,14 @@ #include -constexpr KDColor Palette::LineColor; -constexpr KDColor Palette::BackgroundColor; -constexpr KDColor Palette::CellBackgroundColor; -constexpr KDColor Palette::FocusCellBackgroundColor; -constexpr KDColor Palette::DesactiveTextColor; -constexpr KDColor Palette::BoxTitleBackgroundColor; +constexpr KDColor Palette::YellowOne; +constexpr KDColor Palette::YellowTwo; +constexpr KDColor Palette::PurpleBright; +constexpr KDColor Palette::PurpleDark; +constexpr KDColor Palette::GreyWhite; +constexpr KDColor Palette::GreyBright; +constexpr KDColor Palette::GreyMiddle; +constexpr KDColor Palette::GreyDark; +constexpr KDColor Palette::Select; +constexpr KDColor Palette::WallScreen; +constexpr KDColor Palette::SubTab; +constexpr KDColor Palette::LowBattery; diff --git a/escher/src/scroll_view.cpp b/escher/src/scroll_view.cpp index 2f21f4712..f58a3ede4 100644 --- a/escher/src/scroll_view.cpp +++ b/escher/src/scroll_view.cpp @@ -62,7 +62,7 @@ void ScrollView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate height = bounds().height(); ctx->fillRect(KDRect(0, 0, width, height), m_backgroundColor); // Future optimization: avoid drawing behind the content view/ - //ctx->fillRect(KDRect(m_leftMargin, m_contentView->bounds().height()+m_topMargin, width-m_leftMargin-m_rightMargin, height- m_contentView->bounds().height())-m_topMargin, Palette::BackgroundColor); + //ctx->fillRect(KDRect(m_leftMargin, m_contentView->bounds().height()+m_topMargin, width-m_leftMargin-m_rightMargin, height- m_contentView->bounds().height())-m_topMargin, m_backgroundColor); } diff --git a/escher/src/switch_view.cpp b/escher/src/switch_view.cpp index 8f5eda701..2a6f87510 100644 --- a/escher/src/switch_view.cpp +++ b/escher/src/switch_view.cpp @@ -25,17 +25,18 @@ void SwitchView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate switchHalfHeight = k_switchHeight/2; KDCoordinate switchHalfWidth = k_switchWidth/2; + KDColor mainColor = m_state ? Palette::YellowOne : Palette::GreyDark; // These 4 lines draw the outline of the switch. - ctx->fillRect(KDRect(width - 2*k_separatorThickness - k_switchMargin - k_switchWidth, heightCenter-switchHalfHeight - k_separatorThickness, k_switchWidth + 2*k_separatorThickness, k_separatorThickness), Palette::LineColor); - ctx->fillRect(KDRect(width - 2*k_separatorThickness - k_switchMargin - k_switchWidth, heightCenter-switchHalfHeight, k_separatorThickness, k_switchHeight+k_separatorThickness), Palette::LineColor); - ctx->fillRect(KDRect(width - k_separatorThickness - k_switchMargin - k_switchWidth, heightCenter+switchHalfHeight, k_switchWidth+k_separatorThickness, k_separatorThickness), Palette::LineColor); - ctx->fillRect(KDRect(width - k_separatorThickness - k_switchMargin, heightCenter-switchHalfHeight, k_separatorThickness, k_switchHeight), Palette::LineColor); + ctx->fillRect(KDRect(width - 2*k_separatorThickness - k_switchMargin - k_switchWidth, heightCenter-switchHalfHeight - k_separatorThickness, k_switchWidth + 2*k_separatorThickness, k_separatorThickness), mainColor); + ctx->fillRect(KDRect(width - 2*k_separatorThickness - k_switchMargin - k_switchWidth, heightCenter-switchHalfHeight, k_separatorThickness, k_switchHeight+k_separatorThickness), mainColor); + ctx->fillRect(KDRect(width - k_separatorThickness - k_switchMargin - k_switchWidth, heightCenter+switchHalfHeight, k_switchWidth+k_separatorThickness, k_separatorThickness), mainColor); + ctx->fillRect(KDRect(width - k_separatorThickness - k_switchMargin, heightCenter-switchHalfHeight, k_separatorThickness, k_switchHeight), mainColor); // These next lines fill the switch with black and green/red. if (m_state) { - ctx->fillRect(KDRect(width - k_switchMargin - k_switchWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), KDColorBlack); - ctx->fillRect(KDRect(width - k_switchMargin - switchHalfWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), KDColorGreen); + ctx->fillRect(KDRect(width - k_switchMargin - k_switchWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), KDColorWhite); + ctx->fillRect(KDRect(width - k_switchMargin - switchHalfWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), mainColor); } else { - ctx->fillRect(KDRect(width - k_switchMargin - k_switchWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), KDColorRed); - ctx->fillRect(KDRect(width - k_switchMargin - switchHalfWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), KDColorBlack); + ctx->fillRect(KDRect(width - k_switchMargin - k_switchWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), mainColor); + ctx->fillRect(KDRect(width - k_switchMargin - switchHalfWidth - k_separatorThickness, heightCenter-switchHalfHeight, switchHalfWidth, k_switchHeight), KDColorWhite); } } diff --git a/escher/src/text_menu_list_cell.cpp b/escher/src/text_menu_list_cell.cpp index 3e8faaeff..053504532 100644 --- a/escher/src/text_menu_list_cell.cpp +++ b/escher/src/text_menu_list_cell.cpp @@ -21,13 +21,13 @@ View * TextMenuListCell::accessoryView() const { void TextMenuListCell::reloadCell() { MenuListCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; m_accessoryView.setBackgroundColor(backgroundColor); } void TextMenuListCell::setHighlighted(bool highlight) { MenuListCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor; + KDColor backgroundColor = highlight? Palette::Select : KDColorWhite; m_accessoryView.setBackgroundColor(backgroundColor); }