From c68a0cdb335c67883fdca157cf526443373d273d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Guid=C3=A9e?= Date: Fri, 29 Nov 2019 19:42:39 +0100 Subject: [PATCH] New Default theme: Omega theme! (Beta) --- apps/battery_view.cpp | 14 +-- apps/calculation/history_view_cell.cpp | 2 +- apps/code/console_controller.cpp | 2 +- apps/code/console_line_cell.cpp | 4 +- apps/code/console_line_cell.h | 2 +- apps/code/python_text_area.cpp | 14 +-- apps/code/sandbox_controller.cpp | 2 +- apps/code/script_node_cell.cpp | 6 +- apps/exam_pop_up_controller.h | 2 +- apps/graph/list/list_controller.cpp | 4 +- ...text_field_with_max_length_and_extension.h | 2 +- apps/hardware_test/arrow_view.cpp | 2 +- apps/home/app_cell.cpp | 8 +- apps/home/controller.cpp | 4 +- apps/lock_view.cpp | 2 +- apps/probability/app.cpp | 6 +- apps/probability/calculation_controller.cpp | 2 +- apps/probability/cell.cpp | 6 +- apps/probability/distribution_controller.cpp | 4 +- apps/probability/parameters_controller.cpp | 10 +-- apps/regression/calculation_controller.cpp | 4 +- apps/regression/store_controller.cpp | 2 +- apps/sequence/graph/graph_view.cpp | 2 +- apps/sequence/list/list_controller.cpp | 4 +- apps/settings/sub_menu/about_controller.cpp | 2 +- .../sub_menu/contributors_controller.cpp | 2 +- apps/shared/banner_view.h | 2 +- apps/shared/button_with_separator.cpp | 16 ++-- apps/shared/cursor_view.cpp | 4 +- apps/shared/curve_view.cpp | 6 +- apps/shared/function_expression_cell.cpp | 2 +- apps/shared/function_list_controller.cpp | 4 +- apps/shared/function_title_cell.cpp | 4 +- apps/shared/function_title_cell.h | 2 +- apps/shared/ok_view.cpp | 2 +- apps/shared/range_parameter_controller.cpp | 4 +- apps/shared/round_cursor_view.h | 2 +- ...ble_exact_approximate_expressions_view.cpp | 4 +- apps/shared/sum_graph_controller.cpp | 6 +- apps/shared/text_field_with_extension.h | 2 +- apps/shared/vertical_cursor_view.cpp | 2 +- apps/shift_alpha_lock_view.cpp | 4 +- apps/solver/equation_list_view.cpp | 10 +-- apps/solver/interval_controller.cpp | 8 +- apps/solver/list_controller.cpp | 6 +- apps/solver/solutions_controller.cpp | 4 +- apps/statistics/box_axis_view.cpp | 2 +- apps/statistics/box_view.cpp | 2 +- apps/statistics/calculation_controller.cpp | 2 +- apps/statistics/store_controller.cpp | 2 +- apps/title_bar_view.cpp | 6 +- apps/usb/usb_connected_controller.cpp | 12 +-- apps/variable_box_empty_controller.cpp | 2 +- .../escher/alternate_empty_view_delegate.h | 2 +- escher/include/escher/buffer_text_view.h | 2 +- escher/include/escher/button.h | 4 +- escher/include/escher/editable_text_cell.h | 2 +- .../include/escher/even_odd_expression_cell.h | 2 +- .../escher/even_odd_message_text_cell.h | 2 +- escher/include/escher/expression_view.h | 2 +- .../escher/message_table_cell_with_buffer.h | 2 +- escher/include/escher/message_text_view.h | 2 +- escher/include/escher/palette.h | 85 ++++++++++++++++++- escher/include/escher/pointer_text_view.h | 2 +- escher/include/escher/solid_text_area.h | 2 +- escher/include/escher/stack_view_controller.h | 6 +- escher/include/escher/text_field.h | 2 +- escher/include/escher/text_view.h | 2 +- escher/src/button.cpp | 2 +- escher/src/button_row_controller.cpp | 8 +- escher/src/chevron_view.cpp | 2 +- escher/src/editable_text_cell.cpp | 2 +- escher/src/ellipsis_view.cpp | 2 +- escher/src/even_odd_cell.cpp | 4 +- escher/src/even_odd_editable_text_cell.cpp | 2 +- escher/src/expression_field.cpp | 6 +- escher/src/expression_table_cell.cpp | 4 +- .../expression_table_cell_with_expression.cpp | 4 +- .../expression_table_cell_with_pointer.cpp | 4 +- escher/src/gauge_view.cpp | 8 +- escher/src/key_view.cpp | 2 +- escher/src/layout_field.cpp | 2 +- escher/src/message_table_cell.cpp | 4 +- escher/src/message_table_cell_with_buffer.cpp | 2 +- ...age_table_cell_with_chevron_and_buffer.cpp | 4 +- ...table_cell_with_chevron_and_expression.cpp | 4 +- ...ge_table_cell_with_chevron_and_message.cpp | 4 +- .../message_table_cell_with_editable_text.cpp | 2 +- .../message_table_cell_with_expression.cpp | 4 +- escher/src/message_table_cell_with_gauge.cpp | 2 +- .../src/message_table_cell_with_message.cpp | 2 +- escher/src/nested_menu_controller.cpp | 2 +- escher/src/palette.cpp | 71 +++++++++++++++- escher/src/scroll_view.cpp | 2 +- escher/src/scroll_view_indicator.cpp | 2 +- escher/src/switch_view.cpp | 4 +- escher/src/tab_view_cell.cpp | 8 +- escher/src/table_cell.cpp | 10 +-- escher/src/text_cursor_view.cpp | 2 +- escher/src/toolbox.cpp | 2 +- escher/src/warning_controller.cpp | 4 +- poincare/include/poincare/layout_node.h | 2 +- 102 files changed, 348 insertions(+), 196 deletions(-) diff --git a/apps/battery_view.cpp b/apps/battery_view.cpp index 9e8b97e9c..4e056610d 100644 --- a/apps/battery_view.cpp +++ b/apps/battery_view.cpp @@ -63,7 +63,7 @@ void BatteryView::drawRect(KDContext * ctx, KDRect rect) const { *'content' depends on the charge */ // Draw the left part - ctx->fillRect(KDRect(0, 0, k_elementWidth, k_batteryHeight), KDColorWhite); + ctx->fillRect(KDRect(0, 0, k_elementWidth, k_batteryHeight), Palette::ToolbarText); // Draw the middle part constexpr KDCoordinate batteryInsideX = k_elementWidth+k_separatorThickness; @@ -72,7 +72,7 @@ void BatteryView::drawRect(KDContext * ctx, KDRect rect) const { // Charging: Yellow background with flash ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::YellowLight); KDRect frame((k_batteryWidth-k_flashWidth)/2, 0, k_flashWidth, k_flashHeight); - ctx->blendRectWithMask(frame, KDColorWhite, (const uint8_t *)flashMask, s_flashWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::ToolbarText, (const uint8_t *)flashMask, s_flashWorkingBuffer); } else if (m_chargeState == Ion::Battery::Charge::LOW) { assert(!m_isPlugged); // Low: Quite empty battery @@ -82,22 +82,22 @@ void BatteryView::drawRect(KDContext * ctx, KDRect rect) const { assert(!m_isPlugged); // Middle: Half full battery constexpr KDCoordinate middleChargeWidth = batteryInsideWidth/2; - ctx->fillRect(KDRect(batteryInsideX, 0, middleChargeWidth, k_batteryHeight), KDColorWhite); + ctx->fillRect(KDRect(batteryInsideX, 0, middleChargeWidth, k_batteryHeight), Palette::ToolbarText); ctx->fillRect(KDRect(batteryInsideX+middleChargeWidth, 0, middleChargeWidth, k_batteryHeight), Palette::YellowLight); } else { assert(m_chargeState == Ion::Battery::Charge::FULL); // Full but not plugged: Full battery - ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), KDColorWhite); + ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::ToolbarText); if (m_isPlugged) { // Plugged and full: Full battery with tick KDRect frame((k_batteryWidth-k_tickWidth)/2, (k_batteryHeight-k_tickHeight)/2, k_tickWidth, k_tickHeight); - ctx->blendRectWithMask(frame, Palette::YellowDark, (const uint8_t *)tickMask, s_tickWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::Toolbar, (const uint8_t *)tickMask, s_tickWorkingBuffer); } } // Draw the right part - ctx->fillRect(KDRect(k_batteryWidth-2*k_elementWidth, 0, k_elementWidth, k_batteryHeight), KDColorWhite); - ctx->fillRect(KDRect(k_batteryWidth-k_elementWidth, (k_batteryHeight-k_capHeight)/2, k_elementWidth, k_capHeight), KDColorWhite); + ctx->fillRect(KDRect(k_batteryWidth-2*k_elementWidth, 0, k_elementWidth, k_batteryHeight), Palette::ToolbarText); + ctx->fillRect(KDRect(k_batteryWidth-k_elementWidth, (k_batteryHeight-k_capHeight)/2, k_elementWidth, k_capHeight), Palette::ToolbarText); } KDSize BatteryView::minimalSizeForOptimalDisplay() const { diff --git a/apps/calculation/history_view_cell.cpp b/apps/calculation/history_view_cell.cpp index 0ca0b4bc6..bda919a28 100644 --- a/apps/calculation/history_view_cell.cpp +++ b/apps/calculation/history_view_cell.cpp @@ -107,7 +107,7 @@ void HistoryViewCell::cellDidSelectSubview(HistoryViewCellDataSource::SubviewTyp } KDColor HistoryViewCell::backgroundColor() const { - KDColor background = m_even ? Palette::BackgroundHard : Palette::WallScreen; + KDColor background = m_even ? Palette::CalculationBackgroundEven : Palette::CalculationBackgroundOdd; return background; } diff --git a/apps/code/console_controller.cpp b/apps/code/console_controller.cpp index 724ffeb76..c3e0a0cb1 100644 --- a/apps/code/console_controller.cpp +++ b/apps/code/console_controller.cpp @@ -39,7 +39,7 @@ ConsoleController::ConsoleController(Responder * parentResponder, App * pythonDe #endif { m_selectableTableView.setMargins(0, Metric::CommonRightMargin, 0, Metric::TitleBarExternHorizontalMargin); - m_selectableTableView.setBackgroundColor(Palette::BackgroundHard); + m_selectableTableView.setBackgroundColor(Palette::CodeBackground); m_editCell.setPrompt(sStandardPromptText); for (int i = 0; i < k_numberOfLineCells; i++) { m_cells[i].setParentResponder(&m_selectableTableView); diff --git a/apps/code/console_line_cell.cpp b/apps/code/console_line_cell.cpp index 383f3d3f2..2d9ada321 100644 --- a/apps/code/console_line_cell.cpp +++ b/apps/code/console_line_cell.cpp @@ -17,8 +17,8 @@ void ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::setLine(Consol } void ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), Palette::BackgroundHard); - ctx->drawString(m_line->text(), KDPointZero, ConsoleController::k_font, textColor(m_line), isHighlighted()? Palette::Select : Palette::BackgroundHard); + ctx->fillRect(bounds(), Palette::CodeBackground); + ctx->drawString(m_line->text(), KDPointZero, ConsoleController::k_font, textColor(m_line), isHighlighted()? Palette::CodeBackgroundSelected : Palette::CodeBackground); } KDSize ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::minimalSizeForOptimalDisplay() const { diff --git a/apps/code/console_line_cell.h b/apps/code/console_line_cell.h index c2730b5c7..73b879d0e 100644 --- a/apps/code/console_line_cell.h +++ b/apps/code/console_line_cell.h @@ -53,7 +53,7 @@ private: ConsoleLineView m_consoleLineView; }; static KDColor textColor(ConsoleLine * line) { - return line->isFromCurrentSession() ? Palette::Text : Palette::GreyDark; + return line->isFromCurrentSession() ? Palette::CodeText : Palette::SecondaryText; } MessageTextView m_promptView; ScrollableConsoleLineView m_scrollableView; diff --git a/apps/code/python_text_area.cpp b/apps/code/python_text_area.cpp index 1f6f3e31d..023106dbd 100644 --- a/apps/code/python_text_area.cpp +++ b/apps/code/python_text_area.cpp @@ -10,13 +10,13 @@ extern "C" { namespace Code { -constexpr KDColor CommentColor = KDColor::RGB24(0x999988); -constexpr KDColor NumberColor = KDColor::RGB24(0x009999); -constexpr KDColor KeywordColor = KDColor::RGB24(0xFF000C); +constexpr KDColor CommentColor = Palette::CodeComment; +constexpr KDColor NumberColor = Palette::CodeNumber; +constexpr KDColor KeywordColor = Palette::CodeKeyword; // constexpr KDColor BuiltinColor = KDColor::RGB24(0x0086B3); -constexpr KDColor OperatorColor = KDColor::RGB24(0xd73a49); -constexpr KDColor StringColor = KDColor::RGB24(0x032f62); -constexpr KDColor BackgroundColor = Palette::BackgroundHard; +constexpr KDColor OperatorColor = Palette::CodeOperator; +constexpr KDColor StringColor = Palette::CodeString; +constexpr KDColor BackgroundColor = Palette::CodeBackground; static inline const char * minPointer(const char * x, const char * y) { return x < y ? x : y; } @@ -36,7 +36,7 @@ static inline KDColor TokenColor(mp_token_kind_t tokenKind) { if (tokenKind >= MP_TOKEN_DEL_EQUAL && tokenKind <= MP_TOKEN_DEL_MINUS_MORE) { return OperatorColor; } - return Palette::Text; + return Palette::CodeText; } static inline size_t TokenLength(mp_lexer_t * lex) { diff --git a/apps/code/sandbox_controller.cpp b/apps/code/sandbox_controller.cpp index d79355c3d..a8a7ab932 100644 --- a/apps/code/sandbox_controller.cpp +++ b/apps/code/sandbox_controller.cpp @@ -5,7 +5,7 @@ namespace Code { SandboxController::SandboxController(Responder * parentResponder, MicroPython::ExecutionEnvironment * executionEnvironment) : ViewController(parentResponder), - m_solidColorView(Palette::BackgroundHard), + m_solidColorView(Palette::CodeBackground), m_executionEnvironment(executionEnvironment) { assert(executionEnvironment != nullptr); diff --git a/apps/code/script_node_cell.cpp b/apps/code/script_node_cell.cpp index 667692e9f..68fc8b83a 100644 --- a/apps/code/script_node_cell.cpp +++ b/apps/code/script_node_cell.cpp @@ -23,12 +23,12 @@ void ScriptNodeCell::ScriptNodeView::setScriptStore(ScriptStore * scriptStore) { } void ScriptNodeCell::ScriptNodeView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->drawString(m_scriptNode->name(), KDPoint(0, Metric::TableCellLabelTopMargin), k_font, Palette::Text, isHighlighted()? Palette::Select : Palette::BackgroundHard); + ctx->drawString(m_scriptNode->name(), KDPoint(0, Metric::TableCellLabelTopMargin), k_font, Palette::CodeText, isHighlighted()? Palette::CodeBackgroundSelected : Palette::CodeBackground); KDSize nameSize = k_font->stringSize(m_scriptNode->name()); if (m_scriptNode->type() == ScriptNode::Type::Function) { - ctx->drawString(ScriptNodeCell::k_parentheses, KDPoint(nameSize.width(), Metric::TableCellLabelTopMargin), k_font, Palette::Text, isHighlighted()? Palette::Select : Palette::BackgroundHard); + ctx->drawString(ScriptNodeCell::k_parentheses, KDPoint(nameSize.width(), Metric::TableCellLabelTopMargin), k_font, Palette::CodeText, isHighlighted()? Palette::CodeBackgroundSelected : Palette::CodeBackground); } - ctx->drawString(m_scriptStore->scriptAtIndex(m_scriptNode->scriptIndex()).fullName(), KDPoint(0, Metric::TableCellLabelTopMargin + nameSize.height() + k_verticalMargin), k_font, Palette::GreyDark, isHighlighted()? Palette::Select : Palette::BackgroundHard); + ctx->drawString(m_scriptStore->scriptAtIndex(m_scriptNode->scriptIndex()).fullName(), KDPoint(0, Metric::TableCellLabelTopMargin + nameSize.height() + k_verticalMargin), k_font, Palette::SecondaryText, isHighlighted()? Palette::CodeBackgroundSelected : Palette::CodeBackground); } KDSize ScriptNodeCell::ScriptNodeView::minimalSizeForOptimalDisplay() const { diff --git a/apps/exam_pop_up_controller.h b/apps/exam_pop_up_controller.h index ad888cff9..3bff108f7 100644 --- a/apps/exam_pop_up_controller.h +++ b/apps/exam_pop_up_controller.h @@ -7,7 +7,7 @@ class HighContrastButton : public Button { public: using Button::Button; - virtual KDColor highlightedBackgroundColor() const override { return Palette::YellowDark; } + virtual KDColor highlightedBackgroundColor() const override { return Palette::ButtonBackgroundSelectedHighContrast; } }; class ExamPopUpController : public ViewController { diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp index 9137894b7..99d1906c1 100644 --- a/apps/graph/list/list_controller.cpp +++ b/apps/graph/list/list_controller.cpp @@ -167,7 +167,7 @@ void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) { // Set name and color if the name is not being edited ExpiringPointer function = modelStore()->modelForRecord(modelStore()->recordAtIndex(j)); setFunctionNameInTextField(function, titleCell->textField()); - KDColor functionNameColor = function->isActive() ? function->color() : Palette::GreyDark; + KDColor functionNameColor = function->isActive() ? function->color() : Palette::SecondaryText; titleCell->setColor(functionNameColor); } } @@ -178,7 +178,7 @@ void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int Shared::FunctionListController::willDisplayExpressionCellAtIndex(cell, j); FunctionExpressionCell * myCell = (FunctionExpressionCell *)cell; ExpiringPointer f = modelStore()->modelForRecord(modelStore()->recordAtIndex(j)); - KDColor textColor = f->isActive() ? Palette::Text : Palette::GreyDark; + KDColor textColor = f->isActive() ? Palette::PrimaryText : Palette::SecondaryText; myCell->setTextColor(textColor); } diff --git a/apps/graph/list/text_field_with_max_length_and_extension.h b/apps/graph/list/text_field_with_max_length_and_extension.h index 86783b640..a5da2f1af 100644 --- a/apps/graph/list/text_field_with_max_length_and_extension.h +++ b/apps/graph/list/text_field_with_max_length_and_extension.h @@ -17,7 +17,7 @@ public: const KDFont * size = KDFont::LargeFont, float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, - KDColor textColor = Palette::Text, + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard) : TextFieldWithExtension(extensionLength, parentResponder, textBuffer, textBufferSize, draftTextBufferSize, inputEventHandlerDelegate, delegate, size, horizontalAlignment, verticalAlignment, textColor, backgroundColor) {} void setDraftTextBufferSize(size_t size) { m_contentView.setDraftTextBufferSize(size); } diff --git a/apps/hardware_test/arrow_view.cpp b/apps/hardware_test/arrow_view.cpp index 387cdb155..934904a94 100644 --- a/apps/hardware_test/arrow_view.cpp +++ b/apps/hardware_test/arrow_view.cpp @@ -30,7 +30,7 @@ const uint8_t arrowDownMask[10][9] = { ArrowView::ArrowView() : m_directionIsUp(true), - m_color(Palette::Text) + m_color(Palette::PrimaryText) { } diff --git a/apps/home/app_cell.cpp b/apps/home/app_cell.cpp index 6d1b8ed96..f456c0438 100644 --- a/apps/home/app_cell.cpp +++ b/apps/home/app_cell.cpp @@ -5,7 +5,7 @@ namespace Home { AppCell::AppCell() : HighlightCell(), - m_nameView(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::Text, Palette::BackgroundHard), + m_nameView(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::HomeCellText, Palette::HomeCellTextActive), m_visible(true) { } @@ -13,7 +13,7 @@ AppCell::AppCell() : void AppCell::drawRect(KDContext * ctx, KDRect rect) const { KDSize nameSize = m_nameView.minimalSizeForOptimalDisplay(); - ctx->fillRect(KDRect(0, bounds().height()-nameSize.height() - 2*k_nameHeightMargin, bounds().width(), nameSize.height()+2*k_nameHeightMargin), Palette::BackgroundHard); + ctx->fillRect(KDRect(0, bounds().height()-nameSize.height() - 2*k_nameHeightMargin, bounds().width(), nameSize.height()+2*k_nameHeightMargin), Palette::HomeBackground); } int AppCell::numberOfSubviews() const { @@ -45,8 +45,8 @@ void AppCell::setVisible(bool visible) { } void AppCell::reloadCell() { - m_nameView.setTextColor(isHighlighted() ? Palette::BackgroundHard : Palette::Text); - m_nameView.setBackgroundColor(isHighlighted() ? Palette::YellowDark : Palette::BackgroundHard); + m_nameView.setTextColor(isHighlighted() ? Palette::HomeCellTextActive : Palette::HomeCellText); + m_nameView.setBackgroundColor(isHighlighted() ? Palette::HomeCellBackgroundActive : Palette::HomeCellBackground); } } diff --git a/apps/home/controller.cpp b/apps/home/controller.cpp index 22affba46..cd2919556 100644 --- a/apps/home/controller.cpp +++ b/apps/home/controller.cpp @@ -13,7 +13,7 @@ Controller::ContentView::ContentView(Controller * controller, SelectableTableVie { m_selectableTableView.setVerticalCellOverlap(0); m_selectableTableView.setMargins(0, k_sideMargin, k_bottomMargin, k_sideMargin); - m_selectableTableView.setBackgroundColor(Palette::BackgroundHard); + m_selectableTableView.setBackgroundColor(Palette::HomeBackground); static_cast(m_selectableTableView.decorator())->verticalBar()->setMargin(k_indicatorMargin); } @@ -22,7 +22,7 @@ SelectableTableView * Controller::ContentView::selectableTableView() { } void Controller::ContentView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), Palette::BackgroundHard); + ctx->fillRect(bounds(), Palette::HomeBackground); } void Controller::ContentView::reloadBottomRow(SimpleTableViewDataSource * dataSource, int numberOfIcons, int numberOfColumns) { diff --git a/apps/lock_view.cpp b/apps/lock_view.cpp index 0aa02fdd7..b446a1c19 100644 --- a/apps/lock_view.cpp +++ b/apps/lock_view.cpp @@ -16,7 +16,7 @@ KDColor s_lockWorkingBuffer[LockView::k_lockHeight*LockView::k_lockWidth]; void LockView::drawRect(KDContext * ctx, KDRect rect) const { KDRect frame((bounds().width() - k_lockWidth)/2, (bounds().height()-k_lockHeight)/2, k_lockWidth, k_lockHeight); - ctx->blendRectWithMask(frame, Palette::BackgroundHard, (const uint8_t *)lockMask, s_lockWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::ToolbarText, (const uint8_t *)lockMask, s_lockWorkingBuffer); } KDSize LockView::minimalSizeForOptimalDisplay() const { diff --git a/apps/probability/app.cpp b/apps/probability/app.cpp index f3bb0120e..f247625d2 100644 --- a/apps/probability/app.cpp +++ b/apps/probability/app.cpp @@ -76,11 +76,11 @@ App::App(Snapshot * snapshot) : { switch (snapshot->activePage()) { case Snapshot::Page::Parameters: - m_stackViewController.push(&m_parametersController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); + m_stackViewController.push(&m_parametersController, Palette::BannerFirstText, Palette::BannerFirstBackground, Palette::BannerFirstBorder); break; case Snapshot::Page::Calculations: - m_stackViewController.push(&m_parametersController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); - m_stackViewController.push(&m_calculationController, Palette::BackgroundHard, Palette::SubTab, Palette::SubTab); + m_stackViewController.push(&m_parametersController, Palette::BannerFirstText, Palette::BannerFirstBackground, Palette::BannerFirstBorder); + m_stackViewController.push(&m_calculationController, Palette::BannerSecondText, Palette::BannerSecondBackground, Palette::BannerSecondBorder); default: break; } diff --git a/apps/probability/calculation_controller.cpp b/apps/probability/calculation_controller.cpp index 9d37b2d50..965099bf4 100644 --- a/apps/probability/calculation_controller.cpp +++ b/apps/probability/calculation_controller.cpp @@ -25,7 +25,7 @@ namespace Probability { static inline int minInt(int x, int y) { return x < y ? x : y; } CalculationController::ContentView::ContentView(SelectableTableView * selectableTableView, Distribution * distribution, Calculation * calculation) : - m_titleView(KDFont::SmallFont, I18n::Message::ComputeProbability, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen), + m_titleView(KDFont::SmallFont, I18n::Message::ComputeProbability, 0.5f, 0.5f, Palette::SecondaryText, Palette::BackgroundApps), m_selectableTableView(selectableTableView), m_distributionCurveView(distribution, calculation) { diff --git a/apps/probability/cell.cpp b/apps/probability/cell.cpp index 5e89a364f..cd3fe5578 100644 --- a/apps/probability/cell.cpp +++ b/apps/probability/cell.cpp @@ -5,7 +5,7 @@ namespace Probability { Cell::Cell() : HighlightCell(), - m_labelView(KDFont::LargeFont, (I18n::Message)0, 0, 0.5, Palette::Text, Palette::BackgroundHard), + m_labelView(KDFont::LargeFont, (I18n::Message)0, 0, 0.5, Palette::PrimaryText, Palette::BackgroundHard), m_icon(nullptr), m_focusedIcon(nullptr) { @@ -36,7 +36,7 @@ void Cell::layoutSubviews() { void Cell::reloadCell() { HighlightCell::reloadCell(); - KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted()? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_labelView.setBackgroundColor(backgroundColor); if (isHighlighted()) { m_iconView.setImage(m_focusedIcon); @@ -57,7 +57,7 @@ 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::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted() ? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; ctx->fillRect(KDRect(1, 1, width-2, height-1), backgroundColor); ctx->fillRect(KDRect(0, 0, width, 1), Palette::GreyBright); ctx->fillRect(KDRect(0, 1, 1, height-1), Palette::GreyBright); diff --git a/apps/probability/distribution_controller.cpp b/apps/probability/distribution_controller.cpp index 5238181a3..87b3ec6e5 100644 --- a/apps/probability/distribution_controller.cpp +++ b/apps/probability/distribution_controller.cpp @@ -30,7 +30,7 @@ namespace Probability { DistributionController::ContentView::ContentView(SelectableTableView * selectableTableView) : - m_titleView(KDFont::SmallFont, I18n::Message::ChooseDistribution, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen), + m_titleView(KDFont::SmallFont, I18n::Message::ChooseDistribution, 0.5f, 0.5f, Palette::SecondaryText, Palette::BackgroundApps), m_selectableTableView(selectableTableView) { } @@ -98,7 +98,7 @@ bool Probability::DistributionController::handleEvent(Ion::Events::Event event) if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) { StackViewController * stack = (StackViewController *)parentResponder(); setDistributionAccordingToIndex(selectedRow()); - stack->push(m_parametersController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); + stack->push(m_parametersController, Palette::BannerFirstText, Palette::BannerFirstBackground, Palette::BannerFirstBorder); return true; } return false; diff --git a/apps/probability/parameters_controller.cpp b/apps/probability/parameters_controller.cpp index f59f02e3c..80ad3d32f 100644 --- a/apps/probability/parameters_controller.cpp +++ b/apps/probability/parameters_controller.cpp @@ -8,16 +8,16 @@ namespace Probability { ParametersController::ContentView::ContentView(Responder * parentResponder, SelectableTableView * selectableTableView) : m_numberOfParameters(1), - m_titleView(KDFont::SmallFont, I18n::Message::ChooseParameters, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen), - m_firstParameterDefinition(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::Text, Palette::WallScreen), - m_secondParameterDefinition(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::Text, Palette::WallScreen), + m_titleView(KDFont::SmallFont, I18n::Message::ChooseParameters, 0.5f, 0.5f, Palette::SecondaryText, Palette::BackgroundApps), + m_firstParameterDefinition(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::PrimaryText, Palette::BackgroundApps), + m_secondParameterDefinition(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::PrimaryText, Palette::BackgroundApps), m_selectableTableView(selectableTableView) { } void ParametersController::ContentView::drawRect(KDContext * ctx, KDRect rect) const { int tableHeight = m_selectableTableView->minimalSizeForOptimalDisplay().height(); - ctx->fillRect(KDRect(0, tableHeight, bounds().width(), bounds().height() - tableHeight), Palette::WallScreen); + ctx->fillRect(KDRect(0, tableHeight, bounds().width(), bounds().height() - tableHeight), Palette::BackgroundApps); } MessageTextView * ParametersController::ContentView::parameterDefinitionAtIndex(int index) { @@ -161,7 +161,7 @@ bool ParametersController::textFieldDidFinishEditing(TextField * textField, cons void ParametersController::buttonAction() { StackViewController * stack = stackController(); - stack->push(m_calculationController, Palette::BackgroundHard, Palette::SubTab, Palette::SubTab); + stack->push(m_calculationController, Palette::BannerSecondText, Palette::BannerSecondBackground, Palette::BannerSecondBorder); } } diff --git a/apps/regression/calculation_controller.cpp b/apps/regression/calculation_controller.cpp index 021760dc2..4593e5ee7 100644 --- a/apps/regression/calculation_controller.cpp +++ b/apps/regression/calculation_controller.cpp @@ -35,11 +35,11 @@ CalculationController::CalculationController(Responder * parentResponder, Button m_columnTitleCells[i].setParentResponder(&m_selectableTableView); } for (int i = 0; i < k_numberOfDoubleCalculationCells; i++) { - m_doubleCalculationCells[i].setTextColor(Palette::GreyDark); + m_doubleCalculationCells[i].setTextColor(Palette::SecondaryText); m_doubleCalculationCells[i].setParentResponder(&m_selectableTableView); } for (int i = 0; i < k_numberOfCalculationCells;i++) { - m_calculationCells[i].setTextColor(Palette::GreyDark); + m_calculationCells[i].setTextColor(Palette::SecondaryText); } for (int i = 0; i < k_maxNumberOfDisplayableRows; i++) { m_titleCells[i].setMessageFont(KDFont::SmallFont); diff --git a/apps/regression/store_controller.cpp b/apps/regression/store_controller.cpp index 8102cdc75..6a0496a34 100644 --- a/apps/regression/store_controller.cpp +++ b/apps/regression/store_controller.cpp @@ -43,7 +43,7 @@ void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int bool isValuesColumn = i%Store::k_numberOfColumnsPerSeries == 0; mytitleCell->setSeparatorLeft(isValuesColumn && i > 0); int seriesIndex = i/Store::k_numberOfColumnsPerSeries; - mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::GreyDark : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GreyDark with graph/list_controller and statistics/store_controller + mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::SecondaryText : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GreyDark with graph/list_controller and statistics/store_controller char name[] = {isValuesColumn ? 'X' : 'Y', static_cast('1' + seriesIndex), 0}; mytitleCell->setText(name); } diff --git a/apps/sequence/graph/graph_view.cpp b/apps/sequence/graph/graph_view.cpp index fcffd004d..5a0e51fd1 100644 --- a/apps/sequence/graph/graph_view.cpp +++ b/apps/sequence/graph/graph_view.cpp @@ -30,7 +30,7 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const { } drawDot(ctx, rect, x, y, s->color()); if (x >= m_highlightedStart && x <= m_highlightedEnd && record == m_selectedRecord) { - KDColor color = m_shouldColorHighlighted ? s->color() : Palette::Text; + KDColor color = m_shouldColorHighlighted ? s->color() : Palette::PrimaryText; if (y >= 0.0f) { drawSegment(ctx, rect, Axis::Vertical, x, 0.0f, y, color, 1); } else { diff --git a/apps/sequence/list/list_controller.cpp b/apps/sequence/list/list_controller.cpp index 932060708..f38116d92 100644 --- a/apps/sequence/list/list_controller.cpp +++ b/apps/sequence/list/list_controller.cpp @@ -190,7 +190,7 @@ void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) { myCell->setLayout(sequence->secondInitialConditionName()); } // Set the color - KDColor nameColor = sequence->isActive() ? sequence->color() : Palette::GreyDark; + KDColor nameColor = sequence->isActive() ? sequence->color() : Palette::SecondaryText; myCell->setColor(nameColor); } @@ -208,7 +208,7 @@ void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int myCell->setLayout(sequence->secondInitialConditionLayout()); } bool active = sequence->isActive(); - KDColor textColor = active ? Palette::Text : Palette::GreyDark; + KDColor textColor = active ? Palette::PrimaryText : Palette::SecondaryText; myCell->setTextColor(textColor); } diff --git a/apps/settings/sub_menu/about_controller.cpp b/apps/settings/sub_menu/about_controller.cpp index 4cda6443c..25de2ffac 100644 --- a/apps/settings/sub_menu/about_controller.cpp +++ b/apps/settings/sub_menu/about_controller.cpp @@ -13,7 +13,7 @@ AboutController::AboutController(Responder * parentResponder) : for (int i = 0; i < k_totalNumberOfCell; i++) { m_cells[i].setMessageFont(KDFont::LargeFont); m_cells[i].setAccessoryFont(KDFont::SmallFont); - m_cells[i].setAccessoryTextColor(Palette::GreyDark); + m_cells[i].setAccessoryTextColor(Palette::SecondaryText); } } diff --git a/apps/settings/sub_menu/contributors_controller.cpp b/apps/settings/sub_menu/contributors_controller.cpp index f2665f64f..50364cd62 100644 --- a/apps/settings/sub_menu/contributors_controller.cpp +++ b/apps/settings/sub_menu/contributors_controller.cpp @@ -9,7 +9,7 @@ ContributorsController::ContributorsController(Responder * parentResponder) : for (int i = 0; i < k_totalNumberOfCell; i++) { m_cells[i].setMessageFont(KDFont::LargeFont); m_cells[i].setAccessoryFont(KDFont::SmallFont); - m_cells[i].setAccessoryTextColor(Palette::GreyDark); + m_cells[i].setAccessoryTextColor(Palette::SecondaryText); } } diff --git a/apps/shared/banner_view.h b/apps/shared/banner_view.h index 5aa89857e..0c46da63e 100644 --- a/apps/shared/banner_view.h +++ b/apps/shared/banner_view.h @@ -12,7 +12,7 @@ public: KDSize minimalSizeForOptimalDisplay() const override; void reload() { layoutSubviews(); } static constexpr const KDFont * Font() { return KDFont::SmallFont; } - static constexpr KDColor TextColor() { return Palette::Text; } + static constexpr KDColor TextColor() { return Palette::PrimaryText; } static constexpr KDColor BackgroundColor() { return Palette::GreyMiddle; } private: static constexpr KDCoordinate LineSpacing = 2; diff --git a/apps/shared/button_with_separator.cpp b/apps/shared/button_with_separator.cpp index e548d5cbb..8d2d353b6 100644 --- a/apps/shared/button_with_separator.cpp +++ b/apps/shared/button_with_separator.cpp @@ -1,22 +1,22 @@ #include "button_with_separator.h" ButtonWithSeparator::ButtonWithSeparator(Responder * parentResponder, I18n::Message message, Invocation invocation) : - Button(parentResponder, message, invocation, KDFont::LargeFont, Palette::Text) + Button(parentResponder, message, invocation, KDFont::LargeFont, Palette::ButtonText) { } void ButtonWithSeparator::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - ctx->fillRect(KDRect(0, 0, width, k_lineThickness), Palette::GreyBright); - ctx->fillRect(KDRect(0, k_lineThickness, width, k_margin-k_lineThickness), Palette::WallScreen); + ctx->fillRect(KDRect(0, 0, width, k_lineThickness), Palette::ListCellBorder); + ctx->fillRect(KDRect(0, k_lineThickness, width, k_margin-k_lineThickness), Palette::BackgroundApps); // Draw rectangle around cell - ctx->fillRect(KDRect(0, k_margin, width, k_lineThickness), Palette::GreyBright); - ctx->fillRect(KDRect(0, k_margin+k_lineThickness, k_lineThickness, height-k_margin), Palette::GreyBright); - ctx->fillRect(KDRect(width-k_lineThickness, k_lineThickness+k_margin, k_lineThickness, height-k_margin), Palette::GreyBright); + ctx->fillRect(KDRect(0, k_margin, width, k_lineThickness), Palette::ListCellBorder); + ctx->fillRect(KDRect(0, k_margin+k_lineThickness, k_lineThickness, height-k_margin), Palette::ListCellBorder); + ctx->fillRect(KDRect(width-k_lineThickness, k_lineThickness+k_margin, k_lineThickness, height-k_margin), Palette::ListCellBorder); ctx->fillRect(KDRect(0, height-3*k_lineThickness, width, k_lineThickness), Palette::GreyWhite); - ctx->fillRect(KDRect(0, height-2*k_lineThickness, width, k_lineThickness), Palette::GreyBright); - ctx->fillRect(KDRect(k_lineThickness, height-k_lineThickness, width-2*k_lineThickness, k_lineThickness), Palette::GreyMiddle); + ctx->fillRect(KDRect(0, height-2*k_lineThickness, width, k_lineThickness), Palette::ListCellBorder); + ctx->fillRect(KDRect(k_lineThickness, height-k_lineThickness, width-2*k_lineThickness, k_lineThickness), Palette::ButtonShadow); } diff --git a/apps/shared/cursor_view.cpp b/apps/shared/cursor_view.cpp index 6203810f1..90886b81c 100644 --- a/apps/shared/cursor_view.cpp +++ b/apps/shared/cursor_view.cpp @@ -5,8 +5,8 @@ namespace Shared { void CursorView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - ctx->fillRect(KDRect((width-1)/2, 0, 1, height), Palette::Text); - ctx->fillRect(KDRect(0, (height-1)/2, width, 1), Palette::Text); + ctx->fillRect(KDRect((width-1)/2, 0, 1, height), Palette::PrimaryText); + ctx->fillRect(KDRect(0, (height-1)/2, width, 1), Palette::PrimaryText); } KDSize CursorView::minimalSizeForOptimalDisplay() const { diff --git a/apps/shared/curve_view.cpp b/apps/shared/curve_view.cpp index c5510d395..d83c18bdb 100644 --- a/apps/shared/curve_view.cpp +++ b/apps/shared/curve_view.cpp @@ -301,7 +301,7 @@ void CurveView::drawLabels(KDContext * ctx, KDRect rect, Axis axis, bool shiftOr labelPosition, k_labelGraduationLength, 1); - ctx->fillRect(graduation, Palette::Text); + ctx->fillRect(graduation, Palette::PrimaryText); } } @@ -352,7 +352,7 @@ void CurveView::drawLabels(KDContext * ctx, KDRect rect, Axis axis, bool shiftOr } KDPoint origin = KDPoint(xPosition, yPosition); if (rect.intersects(KDRect(origin, textSize))) { - ctx->drawString(labelI, origin, k_font, Palette::Text, backgroundColor); + ctx->drawString(labelI, origin, k_font, Palette::PrimaryText, backgroundColor); } } } @@ -449,7 +449,7 @@ void CurveView::drawAxes(KDContext * ctx, KDRect rect) const { } void CurveView::drawAxis(KDContext * ctx, KDRect rect, Axis axis) const { - drawLine(ctx, rect, axis, 0.0f, Palette::Text, 1); + drawLine(ctx, rect, axis, 0.0f, Palette::PrimaryText, 1); } #define LINE_THICKNESS 2 diff --git a/apps/shared/function_expression_cell.cpp b/apps/shared/function_expression_cell.cpp index 628040440..9ca6fe9c4 100644 --- a/apps/shared/function_expression_cell.cpp +++ b/apps/shared/function_expression_cell.cpp @@ -8,7 +8,7 @@ KDSize FunctionExpressionCell::minimalSizeForOptimalDisplay() const { } void FunctionExpressionCell::drawRect(KDContext * ctx, KDRect rect) const { - KDColor separatorColor = m_even ? Palette::WallScreen : Palette::BackgroundHard; + KDColor separatorColor = m_even ? Palette::BackgroundApps : Palette::BackgroundHard; // Color the horizontal separator ctx->fillRect(KDRect(0, bounds().height()-k_separatorThickness, bounds().width(), k_separatorThickness), separatorColor); // Color the left margin diff --git a/apps/shared/function_list_controller.cpp b/apps/shared/function_list_controller.cpp index 9b92dc46b..ae1548b3d 100644 --- a/apps/shared/function_list_controller.cpp +++ b/apps/shared/function_list_controller.cpp @@ -16,13 +16,13 @@ FunctionListController::FunctionListController(Responder * parentResponder, Butt TabViewController * tabController = list->tabController(); tabController->setActiveTab(1); return true; - }, this), KDFont::SmallFont, Palette::PurpleBright), + }, this), KDFont::SmallFont, Palette::ButtonText), m_valuesButton(this, I18n::Message::DisplayValues, Invocation([](void * context, void * sender) { FunctionListController * list = (FunctionListController *)context; TabViewController * tabController = list->tabController(); tabController->setActiveTab(2); return true; - }, this), KDFont::SmallFont, Palette::PurpleBright), + }, this), KDFont::SmallFont, Palette::ButtonText), m_titlesColumnWidth(k_minTitleColumnWidth) { /* m_memoizedCellBaseline is not initialized by the call to diff --git a/apps/shared/function_title_cell.cpp b/apps/shared/function_title_cell.cpp index 10cb1150a..4a1b11041 100644 --- a/apps/shared/function_title_cell.cpp +++ b/apps/shared/function_title_cell.cpp @@ -25,8 +25,8 @@ void FunctionTitleCell::setBaseline(KDCoordinate baseline) { void FunctionTitleCell::drawRect(KDContext * ctx, KDRect rect) const { if (m_orientation == Orientation::VerticalIndicator){ - KDColor separatorColor = m_even ? Palette::WallScreen : Palette::BackgroundHard; - KDColor backgroundColor = m_even ? Palette::BackgroundHard : Palette::WallScreen; + KDColor separatorColor = m_even ? Palette::BackgroundApps : Palette::BackgroundHard; + KDColor backgroundColor = m_even ? Palette::BackgroundHard : Palette::BackgroundApps; // Draw the color indicator ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), m_functionColor); // Draw the horizontal separator diff --git a/apps/shared/function_title_cell.h b/apps/shared/function_title_cell.h index 0e557b369..39ea199ac 100644 --- a/apps/shared/function_title_cell.h +++ b/apps/shared/function_title_cell.h @@ -15,7 +15,7 @@ public: EvenOddCell(), m_orientation(orientation), m_baseline(-1), - m_functionColor(Palette::Text) + m_functionColor(Palette::PrimaryText) {} virtual void setOrientation(Orientation orientation); virtual void setColor(KDColor color); diff --git a/apps/shared/ok_view.cpp b/apps/shared/ok_view.cpp index 37577d4bc..3b1e6493a 100644 --- a/apps/shared/ok_view.cpp +++ b/apps/shared/ok_view.cpp @@ -31,7 +31,7 @@ void OkView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); KDRect frame((width-k_okSize)/2, (height-k_okSize)/2, k_okSize, k_okSize); - ctx->blendRectWithMask(frame, Palette::Text, (const uint8_t *)okMask, s_okWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::PrimaryText, (const uint8_t *)okMask, s_okWorkingBuffer); } KDSize OkView::minimalSizeForOptimalDisplay() const { diff --git a/apps/shared/range_parameter_controller.cpp b/apps/shared/range_parameter_controller.cpp index 51d592645..98b9b6bc4 100644 --- a/apps/shared/range_parameter_controller.cpp +++ b/apps/shared/range_parameter_controller.cpp @@ -56,8 +56,8 @@ void RangeParameterController::willDisplayCellForIndex(HighlightCell * cell, int MessageTableCellWithEditableText * myCell = (MessageTableCellWithEditableText *)cell; I18n::Message labels[k_numberOfTextCell+1] = {I18n::Message::XMin, I18n::Message::XMax, I18n::Message::Default, I18n::Message::YMin, I18n::Message::YMax}; myCell->setMessage(labels[index]); - KDColor yColor = m_interactiveRange->yAuto() ? Palette::GreyDark : Palette::Text; - KDColor colors[k_numberOfTextCell+1] = {Palette::Text, Palette::Text, Palette::Text, yColor, yColor}; + KDColor yColor = m_interactiveRange->yAuto() ? Palette::SecondaryText : Palette::PrimaryText; + KDColor colors[k_numberOfTextCell+1] = {Palette::PrimaryText, Palette::PrimaryText, Palette::PrimaryText, yColor, yColor}; myCell->setTextColor(colors[index]); FloatParameterController::willDisplayCellForIndex(cell, index); } diff --git a/apps/shared/round_cursor_view.h b/apps/shared/round_cursor_view.h index 931c86f5b..025d06ee3 100644 --- a/apps/shared/round_cursor_view.h +++ b/apps/shared/round_cursor_view.h @@ -9,7 +9,7 @@ namespace Shared { class RoundCursorView : public CursorView { public: - RoundCursorView(KDColor color = Palette::Text) : m_color(color), m_underneathPixelBufferLoaded(false) {} + RoundCursorView(KDColor color = Palette::PrimaryText) : m_color(color), m_underneathPixelBufferLoaded(false) {} void drawRect(KDContext * ctx, KDRect rect) const override; KDSize minimalSizeForOptimalDisplay() const override; void setColor(KDColor color); diff --git a/apps/shared/scrollable_exact_approximate_expressions_view.cpp b/apps/shared/scrollable_exact_approximate_expressions_view.cpp index c0106c110..ee86a5b8d 100644 --- a/apps/shared/scrollable_exact_approximate_expressions_view.cpp +++ b/apps/shared/scrollable_exact_approximate_expressions_view.cpp @@ -17,7 +17,7 @@ ScrollableExactApproximateExpressionsView::ContentCell::ContentCell() : } KDColor ScrollableExactApproximateExpressionsView::ContentCell::backgroundColor() const { - KDColor background = m_even ? Palette::BackgroundHard : Palette::WallScreen; + KDColor background = m_even ? Palette::CalculationBackgroundEven : Palette::CalculationBackgroundOdd; return background; } @@ -45,7 +45,7 @@ void ScrollableExactApproximateExpressionsView::ContentCell::setEven(bool even) void ScrollableExactApproximateExpressionsView::ContentCell::reloadTextColor() { if (numberOfSubviews() == 1) { - m_rightExpressionView.setTextColor(Palette::Text); + m_rightExpressionView.setTextColor(Palette::PrimaryText); } else { m_rightExpressionView.setTextColor(Palette::GreyVeryDark); } diff --git a/apps/shared/sum_graph_controller.cpp b/apps/shared/sum_graph_controller.cpp index 4b81b68bb..2cfb9f934 100644 --- a/apps/shared/sum_graph_controller.cpp +++ b/apps/shared/sum_graph_controller.cpp @@ -155,10 +155,10 @@ void SumGraphController::reloadBannerView() { /* Legend View */ SumGraphController::LegendView::LegendView(SumGraphController * controller, InputEventHandlerDelegate * inputEventHandlerDelegate, CodePoint sumSymbol) : - m_sum(0.0f, 0.5f, Palette::Text, Palette::GreyMiddle), + m_sum(0.0f, 0.5f, Palette::PrimaryText, Palette::GreyMiddle), m_sumLayout(), - m_legend(k_font, I18n::Message::Default, 0.0f, 0.5f, Palette::Text, Palette::GreyMiddle), - m_editableZone(controller, m_textBuffer, k_editableZoneBufferSize, TextField::maxBufferSize(), inputEventHandlerDelegate, controller, k_font, 0.0f, 0.5f, Palette::Text, Palette::GreyMiddle), + m_legend(k_font, I18n::Message::Default, 0.0f, 0.5f, Palette::PrimaryText, Palette::GreyMiddle), + m_editableZone(controller, m_textBuffer, k_editableZoneBufferSize, TextField::maxBufferSize(), inputEventHandlerDelegate, controller, k_font, 0.0f, 0.5f, Palette::PrimaryText, Palette::GreyMiddle), m_sumSymbol(sumSymbol) { m_textBuffer[0] = 0; diff --git a/apps/shared/text_field_with_extension.h b/apps/shared/text_field_with_extension.h index 6fca0a1fb..dc1f46d81 100644 --- a/apps/shared/text_field_with_extension.h +++ b/apps/shared/text_field_with_extension.h @@ -17,7 +17,7 @@ public: const KDFont * size = KDFont::LargeFont, float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, - KDColor textColor = Palette::Text, + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard) : TextField(parentResponder, textBuffer, textBufferSize, draftTextBufferSize, inputEventHandlerDelegate, delegate, size, horizontalAlignment, verticalAlignment, textColor, backgroundColor), m_extensionLength(extensionLength) diff --git a/apps/shared/vertical_cursor_view.cpp b/apps/shared/vertical_cursor_view.cpp index 03c5b5abb..a4366911d 100644 --- a/apps/shared/vertical_cursor_view.cpp +++ b/apps/shared/vertical_cursor_view.cpp @@ -4,7 +4,7 @@ namespace Shared { void VerticalCursorView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate height = bounds().height(); - ctx->fillRect(KDRect(0, 0, 1, height), Palette::Text); + ctx->fillRect(KDRect(0, 0, 1, height), Palette::PrimaryText); } KDSize VerticalCursorView::minimalSizeForOptimalDisplay() const { diff --git a/apps/shift_alpha_lock_view.cpp b/apps/shift_alpha_lock_view.cpp index 3a444eda0..1dd28c406 100644 --- a/apps/shift_alpha_lock_view.cpp +++ b/apps/shift_alpha_lock_view.cpp @@ -2,13 +2,13 @@ ShiftAlphaLockView::ShiftAlphaLockView() : View(), - m_shiftAlphaView(KDFont::SmallFont, I18n::Message::Default, 1.0f, 0.5f, Palette::BackgroundHard, Palette::YellowDark), + m_shiftAlphaView(KDFont::SmallFont, I18n::Message::Default, 1.0f, 0.5f, Palette::ToolbarText, Palette::Toolbar), m_status(Ion::Events::ShiftAlphaStatus::Default) { } void ShiftAlphaLockView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), Palette::YellowDark); + ctx->fillRect(bounds(), Palette::Toolbar); } bool ShiftAlphaLockView::setStatus(Ion::Events::ShiftAlphaStatus status) { diff --git a/apps/solver/equation_list_view.cpp b/apps/solver/equation_list_view.cpp index 02709caec..4e99a6e13 100644 --- a/apps/solver/equation_list_view.cpp +++ b/apps/solver/equation_list_view.cpp @@ -111,11 +111,11 @@ void EquationListView::BraceView::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(bounds(), Palette::BackgroundHard); KDCoordinate height = bounds().height(); KDCoordinate margin = 3; - ctx->blendRectWithMask(KDRect(margin, 0, braceExtremumWidth, braceExtremumHeight), Palette::Text, (const uint8_t *)topBrace, (KDColor *)(s_braceWorkingBuffer)); - ctx->blendRectWithMask(KDRect(0, height/2-braceCenterHeight/2, braceCenterWidth, braceCenterHeight), Palette::Text, (const uint8_t *)middleBrace, (KDColor *)(s_braceWorkingBuffer)); - ctx->blendRectWithMask(KDRect(margin, height-braceExtremumHeight, braceExtremumWidth, braceExtremumHeight), Palette::Text, (const uint8_t *)bottomBrace, (KDColor *)(s_braceWorkingBuffer)); - ctx->fillRect(KDRect(margin, braceExtremumHeight, 1, height/2-braceCenterHeight/2-braceExtremumHeight), Palette::Text); - ctx->fillRect(KDRect(margin, height/2+braceCenterHeight/2, 1, height/2-braceExtremumHeight/2-braceExtremumHeight), Palette::Text); + ctx->blendRectWithMask(KDRect(margin, 0, braceExtremumWidth, braceExtremumHeight), Palette::PrimaryText, (const uint8_t *)topBrace, (KDColor *)(s_braceWorkingBuffer)); + ctx->blendRectWithMask(KDRect(0, height/2-braceCenterHeight/2, braceCenterWidth, braceCenterHeight), Palette::PrimaryText, (const uint8_t *)middleBrace, (KDColor *)(s_braceWorkingBuffer)); + ctx->blendRectWithMask(KDRect(margin, height-braceExtremumHeight, braceExtremumWidth, braceExtremumHeight), Palette::PrimaryText, (const uint8_t *)bottomBrace, (KDColor *)(s_braceWorkingBuffer)); + ctx->fillRect(KDRect(margin, braceExtremumHeight, 1, height/2-braceCenterHeight/2-braceExtremumHeight), Palette::PrimaryText); + ctx->fillRect(KDRect(margin, height/2+braceCenterHeight/2, 1, height/2-braceExtremumHeight/2-braceExtremumHeight), Palette::PrimaryText); } KDSize EquationListView::BraceView::minimalSizeForOptimalDisplay() const { diff --git a/apps/solver/interval_controller.cpp b/apps/solver/interval_controller.cpp index d4cdb2a97..d92a358fd 100644 --- a/apps/solver/interval_controller.cpp +++ b/apps/solver/interval_controller.cpp @@ -7,14 +7,14 @@ namespace Solver { IntervalController::ContentView::ContentView(SelectableTableView * selectableTableView) : - m_instructions0(KDFont::SmallFont, I18n::Message::ApproximateSolutionIntervalInstruction0, 0.5f, 0.5f, Palette::Text, Palette::WallScreen), - m_instructions1(KDFont::SmallFont, I18n::Message::ApproximateSolutionIntervalInstruction1, 0.5f, 0.5f, Palette::Text, Palette::WallScreen), + m_instructions0(KDFont::SmallFont, I18n::Message::ApproximateSolutionIntervalInstruction0, 0.5f, 0.5f, Palette::PrimaryText, Palette::BackgroundApps), + m_instructions1(KDFont::SmallFont, I18n::Message::ApproximateSolutionIntervalInstruction1, 0.5f, 0.5f, Palette::PrimaryText, Palette::BackgroundApps), m_selectableTableView(selectableTableView) { } void IntervalController::ContentView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(KDRect(0, 0, bounds().width(), k_topMargin), Palette::WallScreen); + ctx->fillRect(KDRect(0, 0, bounds().width(), k_topMargin), Palette::BackgroundApps); } int IntervalController::ContentView::numberOfSubviews() const { @@ -103,7 +103,7 @@ bool IntervalController::textFieldDidFinishEditing(TextField * textField, const void IntervalController::buttonAction() { StackViewController * stack = stackController(); m_equationStore->approximateSolve(textFieldDelegateApp()->localContext()); - stack->push(App::app()->solutionsControllerStack(), Palette::BackgroundHard, Palette::SubTab, Palette::SubTab); + stack->push(App::app()->solutionsControllerStack(), Palette::BannerSecondText, Palette::BannerSecondBackground, Palette::BannerSecondBorder); } } diff --git a/apps/solver/list_controller.cpp b/apps/solver/list_controller.cpp index af83ee444..1ceecbafc 100644 --- a/apps/solver/list_controller.cpp +++ b/apps/solver/list_controller.cpp @@ -18,7 +18,7 @@ ListController::ListController(Responder * parentResponder, EquationStore * equa return true; }, this), KDFont::LargeFont, Palette::PurpleBright), m_modelsParameterController(this, equationStore, this), - m_modelsStackController(nullptr, &m_modelsParameterController, Palette::BackgroundHard, Palette::PurpleDark, Palette::PurpleDark) + m_modelsStackController(nullptr, &m_modelsParameterController, Palette::BannerFirstVariantText, Palette::BannerFirstVariantBackground, Palette::BannerFirstVariantBorder) { m_addNewModel.setAlignment(0.3f, 0.5f); // (EquationListView::k_braceTotalWidth+k_expressionMargin) / (Ion::Display::Width-m_addNewModel.text().size()) = (30+5)/(320-200) for (int i = 0; i < k_maxNumberOfRows; i++) { @@ -188,14 +188,14 @@ void ListController::resolveEquations() { case EquationStore::Error::RequireApproximateSolution: { StackViewController * stack = stackController(); - stack->push(App::app()->intervalController(), Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); + stack->push(App::app()->intervalController(), Palette::BannerFirstText, Palette::BannerFirstBackground, Palette::BannerFirstBorder); return; } default: { assert(e == EquationStore::Error::NoError); StackViewController * stack = stackController(); - stack->push(App::app()->solutionsControllerStack(), Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); + stack->push(App::app()->solutionsControllerStack(), Palette::BannerFirstText, Palette::BannerFirstBackground, Palette::BannerFirstBorder); } } } diff --git a/apps/solver/solutions_controller.cpp b/apps/solver/solutions_controller.cpp index 72e045541..8c1cc915c 100644 --- a/apps/solver/solutions_controller.cpp +++ b/apps/solver/solutions_controller.cpp @@ -18,8 +18,8 @@ namespace Solver { static inline KDCoordinate maxCoordinate(KDCoordinate x, KDCoordinate y) { return x > y ? x : y; } SolutionsController::ContentView::ContentView(SolutionsController * controller) : - m_warningMessageView0(KDFont::SmallFont, I18n::Message::Default, 0.5f, 0.5f, Palette::Text, Palette::WallScreenDark), - m_warningMessageView1(KDFont::SmallFont, I18n::Message::Default, 0.5f, 0.5f, Palette::Text, Palette::WallScreenDark), + m_warningMessageView0(KDFont::SmallFont, I18n::Message::Default, 0.5f, 0.5f, Palette::PrimaryText, Palette::WallScreenDark), + m_warningMessageView1(KDFont::SmallFont, I18n::Message::Default, 0.5f, 0.5f, Palette::PrimaryText, Palette::WallScreenDark), m_selectableTableView(controller), m_displayWarningMoreSolutions(false) { diff --git a/apps/statistics/box_axis_view.cpp b/apps/statistics/box_axis_view.cpp index 74a987bc7..504e6b453 100644 --- a/apps/statistics/box_axis_view.cpp +++ b/apps/statistics/box_axis_view.cpp @@ -8,7 +8,7 @@ namespace Statistics { void BoxAxisView::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(rect, Palette::BackgroundHard); KDRect lineRect = KDRect(0, k_axisMargin, bounds().width(), 1); - ctx->fillRect(lineRect, Palette::Text); + ctx->fillRect(lineRect, Palette::PrimaryText); drawLabels(ctx, rect, Axis::Horizontal, false, false, true, k_axisMargin); } diff --git a/apps/statistics/box_view.cpp b/apps/statistics/box_view.cpp index 0e2ee15f8..b111932c8 100644 --- a/apps/statistics/box_view.cpp +++ b/apps/statistics/box_view.cpp @@ -71,7 +71,7 @@ void BoxView::drawRect(KDContext * ctx, KDRect rect) const { upBoundPixel-lowBoundPixel), boxColor); // Draw the horizontal lines linking the box to the extreme bounds - KDColor horizontalColor = isMainViewSelected() ? m_selectedHistogramColor : Palette::GreyDark; + KDColor horizontalColor = isMainViewSelected() ? m_selectedHistogramColor : Palette::SecondaryText; float segmentOrd = (lowBound + upBound)/ 2.0f; drawSegment(ctx, rect, Axis::Horizontal, segmentOrd, minVal, firstQuart, horizontalColor); drawSegment(ctx, rect, Axis::Horizontal, segmentOrd, thirdQuart, maxVal, horizontalColor); diff --git a/apps/statistics/calculation_controller.cpp b/apps/statistics/calculation_controller.cpp index de553cf1b..187cf4938 100644 --- a/apps/statistics/calculation_controller.cpp +++ b/apps/statistics/calculation_controller.cpp @@ -30,7 +30,7 @@ CalculationController::CalculationController(Responder * parentResponder, Button m_calculationTitleCells[i].setMessageFont(KDFont::SmallFont); } for (int i = 0; i < k_numberOfCalculationCells; i++) { - m_calculationCells[i].setTextColor(Palette::GreyDark); + m_calculationCells[i].setTextColor(Palette::SecondaryText); } m_hideableCell.setHide(true); } diff --git a/apps/statistics/store_controller.cpp b/apps/statistics/store_controller.cpp index 15cead9ad..b5dfe39e2 100644 --- a/apps/statistics/store_controller.cpp +++ b/apps/statistics/store_controller.cpp @@ -54,7 +54,7 @@ void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int I18n::Message sizesMessages[] = {I18n::Message::Sizes1, I18n::Message::Sizes2, I18n::Message::Sizes3}; mytitleCell->setText(I18n::translate(sizesMessages[seriesIndex])); } - mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::GreyDark : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GreyDark with graph/list_controller + mytitleCell->setColor(m_store->numberOfPairsOfSeries(seriesIndex) == 0 ? Palette::SecondaryText : Store::colorOfSeriesAtIndex(seriesIndex)); // TODO Share GreyDark with graph/list_controller } HighlightCell * StoreController::titleCells(int index) { diff --git a/apps/title_bar_view.cpp b/apps/title_bar_view.cpp index 56c701077..577d02b62 100644 --- a/apps/title_bar_view.cpp +++ b/apps/title_bar_view.cpp @@ -9,8 +9,8 @@ using namespace Poincare; TitleBarView::TitleBarView() : View(), - m_titleView(KDFont::SmallFont, I18n::Message::Default, 0.5f, 0.5f, KDColorWhite, Palette::YellowDark), - m_preferenceView(KDFont::SmallFont, 1.0f, 0.5, KDColorWhite, Palette::YellowDark) + m_titleView(KDFont::SmallFont, I18n::Message::Default, 0.5f, 0.5f, Palette::ToolbarText, Palette::Toolbar), + m_preferenceView(KDFont::SmallFont, 1.0f, 0.5, Palette::ToolbarText, Palette::Toolbar) { m_examModeIconView.setImage(ImageStore::ExamIcon); } @@ -18,7 +18,7 @@ TitleBarView::TitleBarView() : void TitleBarView::drawRect(KDContext * ctx, KDRect rect) const { /* As we cheated to layout the title view, we have to fill a very thin * rectangle at the top with the background color. */ - ctx->fillRect(KDRect(0, 0, bounds().width(), 2), Palette::YellowDark); + ctx->fillRect(KDRect(0, 0, bounds().width(), 2), Palette::Toolbar); } void TitleBarView::setTitle(I18n::Message title) { diff --git a/apps/usb/usb_connected_controller.cpp b/apps/usb/usb_connected_controller.cpp index 49ab64ecf..8df17e5a5 100644 --- a/apps/usb/usb_connected_controller.cpp +++ b/apps/usb/usb_connected_controller.cpp @@ -14,14 +14,14 @@ static I18n::Message sUSBConnectedMessages[] = { I18n::Message::ConnectedMessage6}; static KDColor sUSBConnectedColors[] = { - Palette::Text, - Palette::Text, - Palette::Text, + Palette::PrimaryText, + Palette::PrimaryText, + Palette::PrimaryText, Palette::YellowDark, KDColorWhite, - Palette::Text, - Palette::Text, - Palette::Text}; + Palette::PrimaryText, + Palette::PrimaryText, + Palette::PrimaryText}; USBConnectedController::USBConnectedController() : ViewController(nullptr), diff --git a/apps/variable_box_empty_controller.cpp b/apps/variable_box_empty_controller.cpp index 37bcdc694..d3501cff8 100644 --- a/apps/variable_box_empty_controller.cpp +++ b/apps/variable_box_empty_controller.cpp @@ -7,7 +7,7 @@ using namespace Poincare; using namespace Ion; VariableBoxEmptyController::VariableBoxEmptyView::VariableBoxEmptyView() : - m_layoutExample(0.5f, 0.5f, Palette::Text, Palette::WallScreen) + m_layoutExample(0.5f, 0.5f, Palette::PrimaryText, Palette::WallScreen) { for (int i = 0; i < k_numberOfMessages; i++) { m_messages[i].setFont(k_font); diff --git a/escher/include/escher/alternate_empty_view_delegate.h b/escher/include/escher/alternate_empty_view_delegate.h index 5cb8ec66e..05cdac76e 100644 --- a/escher/include/escher/alternate_empty_view_delegate.h +++ b/escher/include/escher/alternate_empty_view_delegate.h @@ -17,7 +17,7 @@ public: class AlternateEmptyViewDefaultDelegate : public AlternateEmptyViewDelegate { public: - AlternateEmptyViewDefaultDelegate() : m_message(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::Text, Palette::WallScreen) {} + AlternateEmptyViewDefaultDelegate() : m_message(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::PrimaryText, Palette::BackgroundApps) {} virtual I18n::Message emptyMessage() = 0; View * emptyView() override { m_message.setMessage(emptyMessage()); diff --git a/escher/include/escher/buffer_text_view.h b/escher/include/escher/buffer_text_view.h index 2371de83c..8367d79b9 100644 --- a/escher/include/escher/buffer_text_view.h +++ b/escher/include/escher/buffer_text_view.h @@ -7,7 +7,7 @@ class BufferTextView : public TextView { public: static constexpr int k_maxNumberOfChar = 256; BufferTextView(const KDFont * font = KDFont::LargeFont, float horizontalAlignment = 0.5f, float verticalAlignment = 0.5f, - KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::ListCellBackground); void setText(const char * text) override; const char * text() const override; void appendText(const char * text); diff --git a/escher/include/escher/button.h b/escher/include/escher/button.h index 7ec7b0a86..c46b3d600 100644 --- a/escher/include/escher/button.h +++ b/escher/include/escher/button.h @@ -10,11 +10,11 @@ class Button : public HighlightCell, public Responder { public: - Button(Responder * parentResponder, I18n::Message textBody, Invocation invocation, const KDFont * font = KDFont::SmallFont, KDColor textColor = Palette::Text); + Button(Responder * parentResponder, I18n::Message textBody, Invocation invocation, const KDFont * font = KDFont::SmallFont, KDColor textColor = Palette::ButtonText); void setMessage(I18n::Message message); bool handleEvent(Ion::Events::Event event) override; void setHighlighted(bool highlight) override; - virtual KDColor highlightedBackgroundColor() const { return Palette::Select; } + virtual KDColor highlightedBackgroundColor() const { return Palette::ButtonBackgroundSelected; } Responder * responder() override { return this; } diff --git a/escher/include/escher/editable_text_cell.h b/escher/include/escher/editable_text_cell.h index b8c99049e..8bf3a3348 100644 --- a/escher/include/escher/editable_text_cell.h +++ b/escher/include/escher/editable_text_cell.h @@ -11,7 +11,7 @@ class EditableTextCell : public HighlightCell, public Responder { public: EditableTextCell(Responder * parentResponder = nullptr, InputEventHandlerDelegate * inputEventHandlerDelegate = nullptr, TextFieldDelegate * delegate = nullptr, const KDFont * font = KDFont::LargeFont, - float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, KDColor textColor = Palette::Text, KDColor = Palette::BackgroundHard, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0); + float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, KDColor textColor = Palette::PrimaryText, KDColor = Palette::BackgroundHard, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0); TextField * textField(); void setMargins(KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0); void setHighlighted(bool highlight) override; diff --git a/escher/include/escher/even_odd_expression_cell.h b/escher/include/escher/even_odd_expression_cell.h index b18a195b2..6286141f6 100644 --- a/escher/include/escher/even_odd_expression_cell.h +++ b/escher/include/escher/even_odd_expression_cell.h @@ -7,7 +7,7 @@ class EvenOddExpressionCell : public EvenOddCell { public: EvenOddExpressionCell(float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, - KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard); void setEven(bool even) override; void setHighlighted(bool highlight) override; void setLayout(Poincare::Layout layout); diff --git a/escher/include/escher/even_odd_message_text_cell.h b/escher/include/escher/even_odd_message_text_cell.h index eb93700a6..6572d8f4e 100644 --- a/escher/include/escher/even_odd_message_text_cell.h +++ b/escher/include/escher/even_odd_message_text_cell.h @@ -11,7 +11,7 @@ public: EvenOddMessageTextCell(const KDFont * font = KDFont::LargeFont); void setEven(bool even) override; void setHighlighted(bool highlight) override; - void setMessage(I18n::Message textContent, KDColor textColor = Palette::Text); + void setMessage(I18n::Message textContent, KDColor textColor = Palette::PrimaryText); void setAlignment(float horizontalAlignment, float verticalAlignment); void setMessageFont(const KDFont * font) { m_messageTextView.setFont(font); } protected: diff --git a/escher/include/escher/expression_view.h b/escher/include/escher/expression_view.h index 5a7ab97bc..fda1f8472 100644 --- a/escher/include/escher/expression_view.h +++ b/escher/include/escher/expression_view.h @@ -14,7 +14,7 @@ class ExpressionView : public View { public: ExpressionView(float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, - KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::ListCellBackground); Poincare::Layout layout() const { return m_layout; } bool setLayout(Poincare::Layout layout); void drawRect(KDContext * ctx, KDRect rect) const override; diff --git a/escher/include/escher/message_table_cell_with_buffer.h b/escher/include/escher/message_table_cell_with_buffer.h index 60e0840be..64866cce2 100644 --- a/escher/include/escher/message_table_cell_with_buffer.h +++ b/escher/include/escher/message_table_cell_with_buffer.h @@ -6,7 +6,7 @@ class MessageTableCellWithBuffer : public MessageTableCell { public: - MessageTableCellWithBuffer(I18n::Message message = (I18n::Message)0, const KDFont * font = KDFont::SmallFont, const KDFont * accessoryFont = KDFont::LargeFont, KDColor accessoryTextColor = Palette::Text); + MessageTableCellWithBuffer(I18n::Message message = (I18n::Message)0, const KDFont * font = KDFont::SmallFont, const KDFont * accessoryFont = KDFont::LargeFont, KDColor accessoryTextColor = Palette::PrimaryText); View * accessoryView() const override; void setHighlighted(bool highlight) override; void setAccessoryText(const char * textBody); diff --git a/escher/include/escher/message_text_view.h b/escher/include/escher/message_text_view.h index b1c89551b..3a20ac48d 100644 --- a/escher/include/escher/message_text_view.h +++ b/escher/include/escher/message_text_view.h @@ -8,7 +8,7 @@ class MessageTextView : public TextView { public: MessageTextView(const KDFont * font = KDFont::LargeFont, I18n::Message message = (I18n::Message)0, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f, - KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::ListCellBackground); void setText(const char * text) override; void setMessage(I18n::Message message); const char * text() const override; diff --git a/escher/include/escher/palette.h b/escher/include/escher/palette.h index af6973a31..dae09e767 100644 --- a/escher/include/escher/palette.h +++ b/escher/include/escher/palette.h @@ -5,8 +5,91 @@ class Palette { public: - constexpr static KDColor Text = KDColor::RGB24(0x000000); + + // Shared + constexpr static KDColor PrimaryText = KDColor::RGB24(0x000000); + constexpr static KDColor SecondaryText = KDColor::RGB24(0x6e6e6e); constexpr static KDColor BackgroundHard = KDColor::RGB24(0xffffff); + constexpr static KDColor BackgroundApps = KDColor::RGB24(0xfafafa); + constexpr static KDColor Toolbar = KDColor::RGB24(0xc03535); + constexpr static KDColor ToolbarText = KDColor::RGB24(0xffffff); + constexpr static KDColor ExpressionInputBackground = KDColor::RGB24(0xe0e0e0); + + // Controls (switches, gauge, arrows...) + constexpr static KDColor Control = KDColor::RGB24(0x00857f); + constexpr static KDColor ControlEnabled = KDColor::RGB24(0x00b2b0); + constexpr static KDColor ControlDisabled = KDColor::RGB24(0x9e9e9e); + + // Calculation + constexpr static KDColor CalculationBackgroundOdd = KDColor::RGB24(0xffffff); + constexpr static KDColor CalculationBackgroundEven = KDColor::RGB24(0xfafafa); + + // Code + constexpr static KDColor CodeBackground = KDColor::RGB24(0x000000); + constexpr static KDColor CodeBackgroundSelected = KDColor::RGB24(0xe0e0e0); + constexpr static KDColor CodeText = KDColor::RGB24(0xffffff); + constexpr static KDColor CodeComment = KDColor::RGB24(0x999988); + constexpr static KDColor CodeNumber = KDColor::RGB24(0x009999); + constexpr static KDColor CodeKeyword = KDColor::RGB24(0xff000c); + constexpr static KDColor CodeOperator = KDColor::RGB24(0xd73a49); + constexpr static KDColor CodeString = KDColor::RGB24(0x032f62); + + // SubMenus + constexpr static KDColor SubMenuBackground = KDColor::RGB24(0xe0e0e0); + constexpr static KDColor SubMenuBorder = KDColor::RGB24(0xfafafa); + constexpr static KDColor SubMenuText = KDColor::RGB24(0x000000); + + // Toolbox + constexpr static KDColor ToolboxHeaderBackground = KDColor::RGB24(0x4a4a4a); + constexpr static KDColor ToolboxHeaderText = KDColor::RGB24(0xffffff); + constexpr static KDColor ToolboxHeaderBorder = KDColor::RGB24(0x4a4a4a); + constexpr static KDColor ToolboxBackground = KDColor::RGB24(0x000000); + + // Lists + constexpr static KDColor ListCellBackground = KDColor::RGB24(0xffffff); + constexpr static KDColor ListCellBackgroundSelected = KDColor::RGB24(0xe0e0e0); + constexpr static KDColor ListCellBorder = KDColor::RGB24(0xededef); + + // Button + constexpr static KDColor ButtonBackground = KDColor::RGB24(0xe0e0e0); + constexpr static KDColor ButtonBackgroundSelected = KDColor::RGB24(0xd1d1d1); + constexpr static KDColor ButtonBackgroundSelectedHighContrast = KDColor::RGB24(0x595959); + constexpr static KDColor ButtonBorder = KDColor::RGB24(0xadadad); + constexpr static KDColor ButtonShadow = KDColor::RGB24(0x003833); + constexpr static KDColor ButtonText = KDColor::RGB24(0x000000); + + // Tabs + constexpr static KDColor TabBackground = KDColor::RGB24(0x4a4a4a); + constexpr static KDColor TabBackgroundSelected = KDColor::RGB24(0x757575); + constexpr static KDColor TabBackgroundActive = KDColor::RGB24(0xfafafa); + constexpr static KDColor TabBackgroundSelectedAndActive = KDColor::RGB24(0xe3e3e3); + constexpr static KDColor TabText = KDColor::RGB24(0xffffff); + constexpr static KDColor TabTextActive = KDColor::RGB24(0x000000); + + // SubTabs + constexpr static KDColor SubTabBackground = KDColor::RGB24(0xe0e0e0); + constexpr static KDColor SubTabBackgroundSelected = KDColor::RGB24(0xd1d1d1); + constexpr static KDColor SubTabText = KDColor::RGB24(0x000000); + + // Banners + constexpr static KDColor BannerFirstBackground = KDColor::RGB24(0x4a4a4a); + constexpr static KDColor BannerFirstBorder = KDColor::RGB24(0x4a4a4a); + constexpr static KDColor BannerFirstText = KDColor::RGB24(0xffffff); + constexpr static KDColor BannerFirstVariantBackground = KDColor::RGB24(0x4a4a4a); + constexpr static KDColor BannerFirstVariantBorder = KDColor::RGB24(0xfafafa); + constexpr static KDColor BannerFirstVariantText = KDColor::RGB24(0xffffff); + constexpr static KDColor BannerSecondBackground = KDColor::RGB24(0xe0e0e0); + constexpr static KDColor BannerSecondBorder = KDColor::RGB24(0xfafafa); + constexpr static KDColor BannerSecondText = KDColor::RGB24(0x000000); + + // Home + constexpr static KDColor HomeBackground = KDColor::RGB24(0xffffff); + constexpr static KDColor HomeCellBackground = KDColor::RGB24(0xffffff); + constexpr static KDColor HomeCellBackgroundActive = KDColor::RGB24(0x4a4a4a); + constexpr static KDColor HomeCellText = KDColor::RGB24(0x000000); + constexpr static KDColor HomeCellTextActive = KDColor::RGB24(0xffffff); + + // Defaults constexpr static KDColor YellowDark = KDColor::RGB24(0xffb734); constexpr static KDColor YellowLight = KDColor::RGB24(0xffcc7b); constexpr static KDColor PurpleBright = KDColor::RGB24(0x656975); diff --git a/escher/include/escher/pointer_text_view.h b/escher/include/escher/pointer_text_view.h index d3b163b8f..7158d626c 100644 --- a/escher/include/escher/pointer_text_view.h +++ b/escher/include/escher/pointer_text_view.h @@ -7,7 +7,7 @@ class PointerTextView : public TextView { public: PointerTextView(const KDFont * font = KDFont::LargeFont, const char * text = nullptr, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f, - KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard); const char * text() const override { return m_text; } void setText(const char * text) override; private: diff --git a/escher/include/escher/solid_text_area.h b/escher/include/escher/solid_text_area.h index 4fa3a3741..e80908c9d 100644 --- a/escher/include/escher/solid_text_area.h +++ b/escher/include/escher/solid_text_area.h @@ -9,7 +9,7 @@ class SolidTextArea : public TextArea { public: SolidTextArea(Responder * parentResponder, const KDFont * font = KDFont::LargeFont, - KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard) : + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard) : TextArea(parentResponder, &m_contentView, font), m_contentView(font, textColor, backgroundColor) {} protected: diff --git a/escher/include/escher/stack_view_controller.h b/escher/include/escher/stack_view_controller.h index 96bb93cda..7fbf58db4 100644 --- a/escher/include/escher/stack_view_controller.h +++ b/escher/include/escher/stack_view_controller.h @@ -10,10 +10,10 @@ constexpr uint8_t kMaxNumberOfStacks = 4; class StackViewController : public ViewController { public: StackViewController(Responder * parentResponder, ViewController * rootViewController, - KDColor textColor = Palette::SubTab, KDColor backgroundColor = Palette::BackgroundHard, KDColor separatorColor = Palette::GreyBright); + KDColor textColor = Palette::SubMenuText, KDColor backgroundColor = Palette::SubMenuBackground, KDColor separatorColor = Palette::SubMenuBorder); /* Push creates a new StackView and adds it */ - void push(ViewController * vc, KDColor textColor = Palette::SubTab, KDColor backgroundColor = Palette::BackgroundHard, KDColor separatorColor = Palette::GreyBright); + void push(ViewController * vc, KDColor textColor = Palette::SubMenuText, KDColor backgroundColor = Palette::SubMenuBackground, KDColor separatorColor = Palette::SubMenuBorder); void pop(); int depth(); @@ -27,7 +27,7 @@ public: private: class Frame { public: - Frame(ViewController * viewController = nullptr, KDColor textColor = Palette::SubTab, KDColor backgroundColor = Palette::BackgroundHard, KDColor separatorColor = Palette::GreyBright) : + Frame(ViewController * viewController = nullptr, KDColor textColor = Palette::SubMenuText, KDColor backgroundColor = Palette::SubMenuBackground, KDColor separatorColor = Palette::SubMenuBorder) : m_viewController(viewController), m_textColor(textColor), m_backgroundColor(backgroundColor), diff --git a/escher/include/escher/text_field.h b/escher/include/escher/text_field.h index 20477b774..88ca4ad4a 100644 --- a/escher/include/escher/text_field.h +++ b/escher/include/escher/text_field.h @@ -19,7 +19,7 @@ public: TextField(Responder * parentResponder, char * textBuffer, size_t textBufferSize, size_t draftTextBufferSize, InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * delegate = nullptr, const KDFont * font = KDFont::LargeFont, float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, - KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); + KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard); void setBackgroundColor(KDColor backgroundColor) override; void setTextColor(KDColor textColor); void setDelegates(InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * delegate) { m_inputEventHandlerDelegate = inputEventHandlerDelegate; m_delegate = delegate; } diff --git a/escher/include/escher/text_view.h b/escher/include/escher/text_view.h index 9c4fa1f70..eca7a16d0 100644 --- a/escher/include/escher/text_view.h +++ b/escher/include/escher/text_view.h @@ -11,7 +11,7 @@ class TextView : public View { public: - TextView(const KDFont * font = KDFont::LargeFont, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f, KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard) : + TextView(const KDFont * font = KDFont::LargeFont, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f, KDColor textColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard) : View(), m_font(font), m_horizontalAlignment(horizontalAlignment), diff --git a/escher/src/button.cpp b/escher/src/button.cpp index 68f65bfba..21c73c067 100644 --- a/escher/src/button.cpp +++ b/escher/src/button.cpp @@ -38,7 +38,7 @@ bool Button::handleEvent(Ion::Events::Event event) { void Button::setHighlighted(bool highlight) { HighlightCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? highlightedBackgroundColor() : Palette::BackgroundHard; + KDColor backgroundColor = highlight? highlightedBackgroundColor() : Palette::ButtonBackground; m_messageTextView.setBackgroundColor(backgroundColor); markRectAsDirty(bounds()); } diff --git a/escher/src/button_row_controller.cpp b/escher/src/button_row_controller.cpp index 9bf98681e..f8efb01b9 100644 --- a/escher/src/button_row_controller.cpp +++ b/escher/src/button_row_controller.cpp @@ -102,10 +102,10 @@ void ButtonRowController::ContentView::drawRect(KDContext * ctx, KDRect rect) co } if (m_style == Style::PlainWhite) { if (m_position == Position::Top) { - ctx->fillRect(KDRect(0, 0, bounds().width(), k_plainStyleHeight), Palette::BackgroundHard); + ctx->fillRect(KDRect(0, 0, bounds().width(), k_plainStyleHeight), Palette::SubTabBackground); ctx->fillRect(KDRect(0, k_plainStyleHeight, bounds().width(), 1), Palette::GreyWhite); } else { - ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight, bounds().width(), k_plainStyleHeight), Palette::BackgroundHard); + ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight, bounds().width(), k_plainStyleHeight), Palette::SubTabBackground); ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight-1, bounds().width(), 1), Palette::GreyWhite); } return; @@ -133,10 +133,10 @@ void ButtonRowController::ContentView::drawRect(KDContext * ctx, KDRect rect) co Button * button = buttonAtIndex(i); KDCoordinate buttonWidth = button->minimalSizeForOptimalDisplay().width(); ctx->fillRect(KDRect(currentXOrigin, y0, 1, y1-y0+1), Palette::GreyMiddle); - ctx->fillRect(KDRect(currentXOrigin-1, y0, 1, y1-y0+2), Palette::GreyDark); + ctx->fillRect(KDRect(currentXOrigin-1, y0, 1, y1-y0+2), Palette::SecondaryText); ctx->fillRect(KDRect(currentXOrigin, y0, buttonWidth+2, 1), Palette::GreyMiddle); ctx->fillRect(KDRect(currentXOrigin, y1, buttonWidth+2, 1), Palette::GreyMiddle); - ctx->fillRect(KDRect(currentXOrigin, y1+1, buttonWidth+2, 1), Palette::GreyDark); + ctx->fillRect(KDRect(currentXOrigin, y1+1, buttonWidth+2, 1), Palette::SecondaryText); ctx->fillRect(KDRect(currentXOrigin+1+buttonWidth, y0, 1, y1-y0+1), Palette::GreyMiddle); currentXOrigin += buttonWidth + widthMargin; } diff --git a/escher/src/chevron_view.cpp b/escher/src/chevron_view.cpp index b6c7b32d2..29e8e1ea9 100644 --- a/escher/src/chevron_view.cpp +++ b/escher/src/chevron_view.cpp @@ -24,7 +24,7 @@ void ChevronView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate heightCenter = bounds().height()/2; KDCoordinate chevronHalfHeight = k_chevronHeight/2; KDRect frame(width - k_chevronWidth, heightCenter -chevronHalfHeight, k_chevronWidth, k_chevronHeight); - ctx->blendRectWithMask(frame, Palette::YellowDark, (const uint8_t *)chevronMask, s_workingBuffer); + ctx->blendRectWithMask(frame, Palette::Control, (const uint8_t *)chevronMask, s_workingBuffer); } KDSize ChevronView::minimalSizeForOptimalDisplay() const { diff --git a/escher/src/editable_text_cell.cpp b/escher/src/editable_text_cell.cpp index 23879f90f..dfdf325a1 100644 --- a/escher/src/editable_text_cell.cpp +++ b/escher/src/editable_text_cell.cpp @@ -30,7 +30,7 @@ TextField * EditableTextCell::textField() { void EditableTextCell::setHighlighted(bool highlight) { HighlightCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_textField.setBackgroundColor(backgroundColor); } diff --git a/escher/src/ellipsis_view.cpp b/escher/src/ellipsis_view.cpp index 01c1e5782..b7d63f908 100644 --- a/escher/src/ellipsis_view.cpp +++ b/escher/src/ellipsis_view.cpp @@ -19,7 +19,7 @@ void EllipsisView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate heightCenter = bounds().height()/2; KDCoordinate ellipsisHalfHeight = k_ellipsisHeight/2; KDRect frame(widthCenter - ellipsisHalfWidth, heightCenter - ellipsisHalfHeight, k_ellipsisWidth, k_ellipsisHeight); - ctx->blendRectWithMask(frame, Palette::Text, (const uint8_t *)ellipsisMask, s_ellipsisWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::PrimaryText, (const uint8_t *)ellipsisMask, s_ellipsisWorkingBuffer); } KDSize EllipsisView::minimalSizeForOptimalDisplay() const { diff --git a/escher/src/even_odd_cell.cpp b/escher/src/even_odd_cell.cpp index c3e3c5aef..7aa2a15be 100644 --- a/escher/src/even_odd_cell.cpp +++ b/escher/src/even_odd_cell.cpp @@ -16,8 +16,8 @@ void EvenOddCell::setEven(bool even) { KDColor EvenOddCell::backgroundColor() const { // Select the background color according to the even line and the cursor selection - KDColor background = m_even ? Palette::BackgroundHard : Palette::WallScreen ; - background = isHighlighted() ? Palette::Select : background; + KDColor background = m_even ? Palette::BackgroundHard : Palette::BackgroundApps ; + background = isHighlighted() ? Palette::ListCellBackgroundSelected : background; return background; } diff --git a/escher/src/even_odd_editable_text_cell.cpp b/escher/src/even_odd_editable_text_cell.cpp index 24da5d1dd..583a938fb 100644 --- a/escher/src/even_odd_editable_text_cell.cpp +++ b/escher/src/even_odd_editable_text_cell.cpp @@ -5,7 +5,7 @@ EvenOddEditableTextCell::EvenOddEditableTextCell(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * delegate, const KDFont * font, float horizontalAlignment, float verticalAlignment, KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin) : EvenOddCell(), Responder(parentResponder), - m_editableCell(this, inputEventHandlerDelegate, delegate, font, horizontalAlignment, verticalAlignment, Palette::Text, Palette::BackgroundHard, topMargin, rightMargin, bottomMargin, leftMargin) + m_editableCell(this, inputEventHandlerDelegate, delegate, font, horizontalAlignment, verticalAlignment, Palette::PrimaryText, Palette::BackgroundHard, topMargin, rightMargin, bottomMargin, leftMargin) { } diff --git a/escher/src/expression_field.cpp b/escher/src/expression_field.cpp index 3c0a92f17..4d1a70dc4 100644 --- a/escher/src/expression_field.cpp +++ b/escher/src/expression_field.cpp @@ -8,15 +8,15 @@ static inline KDCoordinate maxCoordinate(KDCoordinate x, KDCoordinate y) { retur ExpressionField::ExpressionField(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * textFieldDelegate, LayoutFieldDelegate * layoutFieldDelegate) : Responder(parentResponder), View(), - m_textField(parentResponder, nullptr, k_textFieldBufferSize, k_textFieldBufferSize, inputEventHandlerDelegate, textFieldDelegate, KDFont::LargeFont, 0.0f, 0.5f, Palette::Text, Palette::BackgroundHard), + m_textField(parentResponder, nullptr, k_textFieldBufferSize, k_textFieldBufferSize, inputEventHandlerDelegate, textFieldDelegate, KDFont::LargeFont, 0.0f, 0.5f, Palette::PrimaryText, Palette::ExpressionInputBackground), m_layoutField(parentResponder, inputEventHandlerDelegate, layoutFieldDelegate) { // Initialize text field m_textField.setMargins(0, k_horizontalMargin, 0, k_horizontalMargin); - m_textField.setBackgroundColor(Palette::BackgroundHard); + m_textField.setBackgroundColor(Palette::ExpressionInputBackground); // Initialize layout field m_layoutField.setMargins(k_verticalMargin, k_horizontalMargin, k_verticalMargin, k_horizontalMargin); - m_layoutField.setBackgroundColor(Palette::BackgroundHard); + m_layoutField.setBackgroundColor(Palette::ExpressionInputBackground); } void ExpressionField::setEditing(bool isEditing, bool reinitDraftBuffer) { diff --git a/escher/src/expression_table_cell.cpp b/escher/src/expression_table_cell.cpp index 5aad99c94..33c9c4842 100644 --- a/escher/src/expression_table_cell.cpp +++ b/escher/src/expression_table_cell.cpp @@ -4,7 +4,7 @@ ExpressionTableCell::ExpressionTableCell(Layout layout) : TableCell(layout), - m_labelExpressionView(0.0f, 0.5f, Palette::Text, Palette::BackgroundHard) + m_labelExpressionView(0.0f, 0.5f, Palette::PrimaryText, Palette::ListCellBackground) { } @@ -14,7 +14,7 @@ View * ExpressionTableCell::labelView() const { void ExpressionTableCell::setHighlighted(bool highlight) { TableCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_labelExpressionView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/expression_table_cell_with_expression.cpp b/escher/src/expression_table_cell_with_expression.cpp index 9e5443300..cb3ac3f86 100644 --- a/escher/src/expression_table_cell_with_expression.cpp +++ b/escher/src/expression_table_cell_with_expression.cpp @@ -4,7 +4,7 @@ ExpressionTableCellWithExpression::ExpressionTableCellWithExpression() : ExpressionTableCell(Layout::Horizontal), - m_accessoryExpressionView(1.0f, 0.5f, Palette::GreyDark, Palette::BackgroundHard) + m_accessoryExpressionView(1.0f, 0.5f, Palette::SecondaryText, Palette::ListCellBackground) {} View * ExpressionTableCellWithExpression::accessoryView() const { @@ -13,7 +13,7 @@ View * ExpressionTableCellWithExpression::accessoryView() const { void ExpressionTableCellWithExpression::setHighlighted(bool highlight) { ExpressionTableCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_accessoryExpressionView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/expression_table_cell_with_pointer.cpp b/escher/src/expression_table_cell_with_pointer.cpp index 40b877940..f29e9ef9d 100644 --- a/escher/src/expression_table_cell_with_pointer.cpp +++ b/escher/src/expression_table_cell_with_pointer.cpp @@ -4,7 +4,7 @@ ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(I18n::Message accessoryMessage, Layout layout) : ExpressionTableCell(layout), - m_accessoryView(KDFont::SmallFont, accessoryMessage, 0.0f, 0.5f, Palette::GreyDark, Palette::BackgroundHard) + m_accessoryView(KDFont::SmallFont, accessoryMessage, 0.0f, 0.5f, Palette::SecondaryText, Palette::ListCellBackground) { if (layout == Layout::Horizontal) { m_accessoryView.setAlignment(1.0f, 0.5f); @@ -17,7 +17,7 @@ View * ExpressionTableCellWithPointer::accessoryView() const { void ExpressionTableCellWithPointer::setHighlighted(bool highlight) { ExpressionTableCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_accessoryView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/gauge_view.cpp b/escher/src/gauge_view.cpp index c08c35b2c..1d695299b 100644 --- a/escher/src/gauge_view.cpp +++ b/escher/src/gauge_view.cpp @@ -16,7 +16,7 @@ const uint8_t gaugeIndicatorMask[GaugeView::k_indicatorDiameter][GaugeView::k_in GaugeView::GaugeView() : m_level(1), - m_backgroundColor(Palette::BackgroundHard) + m_backgroundColor(Palette::ListCellBackground) { } @@ -48,10 +48,10 @@ void GaugeView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width()-k_indicatorDiameter; KDCoordinate height = bounds().height(); - ctx->fillRect(KDRect(k_indicatorDiameter/2, (height-k_thickness)/2, width*m_level, k_thickness), Palette::YellowDark); - ctx->fillRect(KDRect(k_indicatorDiameter/2+width*m_level, (height-k_thickness)/2, width*(1.0f-m_level), k_thickness), Palette::GreyDark); + ctx->fillRect(KDRect(k_indicatorDiameter/2, (height-k_thickness)/2, width*m_level, k_thickness), Palette::ControlEnabled); + ctx->fillRect(KDRect(k_indicatorDiameter/2+width*m_level, (height-k_thickness)/2, width*(1.0f-m_level), k_thickness), Palette::ControlDisabled); KDRect frame(width*m_level, (height-k_indicatorDiameter)/2, k_indicatorDiameter, k_indicatorDiameter); - ctx->blendRectWithMask(frame, Palette::YellowDark, (const uint8_t *)gaugeIndicatorMask, s_gaugeIndicatorWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::Control, (const uint8_t *)gaugeIndicatorMask, s_gaugeIndicatorWorkingBuffer); } KDSize GaugeView::minimalSizeForOptimalDisplay() const { diff --git a/escher/src/key_view.cpp b/escher/src/key_view.cpp index ba82e3daf..bbcc87278 100644 --- a/escher/src/key_view.cpp +++ b/escher/src/key_view.cpp @@ -84,7 +84,7 @@ void KeyView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); KDRect frame((width - k_keySize)/2, (height - k_keySize)/2, k_keySize, k_keySize); - ctx->blendRectWithMask(frame, Palette::Text, mask(), s_keyWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::PrimaryText, mask(), s_keyWorkingBuffer); } KDSize KeyView::minimalSizeForOptimalDisplay() const { diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index bfe8b7304..43796de71 100644 --- a/escher/src/layout_field.cpp +++ b/escher/src/layout_field.cpp @@ -12,7 +12,7 @@ static inline KDCoordinate minCoordinate(KDCoordinate x, KDCoordinate y) { retur LayoutField::ContentView::ContentView() : m_cursor(), - m_expressionView(0.0f, 0.5f, Palette::Text, Palette::BackgroundHard), + m_expressionView(0.0f, 0.5f, Palette::PrimaryText, Palette::BackgroundHard), m_cursorView(), m_isEditing(false) { diff --git a/escher/src/message_table_cell.cpp b/escher/src/message_table_cell.cpp index a1e63c5b4..0f368d6f4 100644 --- a/escher/src/message_table_cell.cpp +++ b/escher/src/message_table_cell.cpp @@ -4,7 +4,7 @@ MessageTableCell::MessageTableCell(I18n::Message label, const KDFont * font, Layout layout) : TableCell(layout), - m_messageTextView(font, label, 0, 0.5, Palette::Text, Palette::BackgroundHard) + m_messageTextView(font, label, 0, 0.5, Palette::PrimaryText, Palette::ListCellBackground) { } @@ -14,7 +14,7 @@ View * MessageTableCell::labelView() const { void MessageTableCell::setHighlighted(bool highlight) { HighlightCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_messageTextView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_buffer.cpp b/escher/src/message_table_cell_with_buffer.cpp index 166a6073e..127e63113 100644 --- a/escher/src/message_table_cell_with_buffer.cpp +++ b/escher/src/message_table_cell_with_buffer.cpp @@ -22,7 +22,7 @@ View * MessageTableCellWithBuffer::accessoryView() const { void MessageTableCellWithBuffer::setHighlighted(bool highlight) { MessageTableCell::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted()? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_accessoryView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_chevron_and_buffer.cpp b/escher/src/message_table_cell_with_chevron_and_buffer.cpp index 366c60dd4..db2a17b68 100644 --- a/escher/src/message_table_cell_with_chevron_and_buffer.cpp +++ b/escher/src/message_table_cell_with_chevron_and_buffer.cpp @@ -3,7 +3,7 @@ MessageTableCellWithChevronAndBuffer::MessageTableCellWithChevronAndBuffer(const KDFont * labelFont, const KDFont * subAccessoryFont) : MessageTableCellWithChevron((I18n::Message)0, labelFont), - m_subAccessoryView(subAccessoryFont, 1.0f, 0.5f, Palette::GreyDark) + m_subAccessoryView(subAccessoryFont, 1.0f, 0.5f, Palette::SecondaryText) { } @@ -13,7 +13,7 @@ View * MessageTableCellWithChevronAndBuffer::subAccessoryView() const { void MessageTableCellWithChevronAndBuffer::setHighlighted(bool highlight) { MessageTableCellWithChevron::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted()? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_subAccessoryView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_chevron_and_expression.cpp b/escher/src/message_table_cell_with_chevron_and_expression.cpp index e97dac6ed..723acc9ae 100644 --- a/escher/src/message_table_cell_with_chevron_and_expression.cpp +++ b/escher/src/message_table_cell_with_chevron_and_expression.cpp @@ -4,7 +4,7 @@ MessageTableCellWithChevronAndExpression::MessageTableCellWithChevronAndExpression(I18n::Message message, const KDFont * font) : MessageTableCellWithChevron(message, font), - m_subtitleView(1.0f, 0.5f, Palette::GreyDark) + m_subtitleView(1.0f, 0.5f, Palette::SecondaryText) { m_subtitleView.setHorizontalMargin(Metric::ExpressionViewHorizontalMargin); } @@ -15,7 +15,7 @@ View * MessageTableCellWithChevronAndExpression::subAccessoryView() const { void MessageTableCellWithChevronAndExpression::setHighlighted(bool highlight) { MessageTableCellWithChevron::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted()? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_subtitleView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_chevron_and_message.cpp b/escher/src/message_table_cell_with_chevron_and_message.cpp index afa869da0..4e8cd6b7a 100644 --- a/escher/src/message_table_cell_with_chevron_and_message.cpp +++ b/escher/src/message_table_cell_with_chevron_and_message.cpp @@ -3,7 +3,7 @@ MessageTableCellWithChevronAndMessage::MessageTableCellWithChevronAndMessage(const KDFont * labelFont, const KDFont * contentFont) : MessageTableCellWithChevron((I18n::Message)0, labelFont), - m_subtitleView(contentFont, (I18n::Message)0, 1.0f, 0.5f, Palette::GreyDark) + m_subtitleView(contentFont, (I18n::Message)0, 1.0f, 0.5f, Palette::SecondaryText) { } @@ -13,7 +13,7 @@ View * MessageTableCellWithChevronAndMessage::subAccessoryView() const { void MessageTableCellWithChevronAndMessage::setHighlighted(bool highlight) { MessageTableCellWithChevron::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted()? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_subtitleView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_editable_text.cpp b/escher/src/message_table_cell_with_editable_text.cpp index 96977c9f0..63bd44865 100644 --- a/escher/src/message_table_cell_with_editable_text.cpp +++ b/escher/src/message_table_cell_with_editable_text.cpp @@ -32,7 +32,7 @@ void MessageTableCellWithEditableText::setEditing(bool isEditing) { void MessageTableCellWithEditableText::setHighlighted(bool highlight) { MessageTableCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_textField.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_expression.cpp b/escher/src/message_table_cell_with_expression.cpp index b1949e3bd..6b3f5b5d1 100644 --- a/escher/src/message_table_cell_with_expression.cpp +++ b/escher/src/message_table_cell_with_expression.cpp @@ -3,7 +3,7 @@ MessageTableCellWithExpression::MessageTableCellWithExpression(I18n::Message message, const KDFont * font) : MessageTableCell(message, font), - m_subtitleView(1.0f, 0.5f, Palette::GreyDark) + m_subtitleView(1.0f, 0.5f, Palette::SecondaryText) { } @@ -13,7 +13,7 @@ View * MessageTableCellWithExpression::accessoryView() const { void MessageTableCellWithExpression::setHighlighted(bool highlight) { MessageTableCell::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted()? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_subtitleView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_gauge.cpp b/escher/src/message_table_cell_with_gauge.cpp index 9524daa02..f9b996a8b 100644 --- a/escher/src/message_table_cell_with_gauge.cpp +++ b/escher/src/message_table_cell_with_gauge.cpp @@ -13,6 +13,6 @@ View * MessageTableCellWithGauge::accessoryView() const { void MessageTableCellWithGauge::setHighlighted(bool highlight) { MessageTableCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_accessoryView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/message_table_cell_with_message.cpp b/escher/src/message_table_cell_with_message.cpp index 4f4fc1740..16cfd3c6e 100644 --- a/escher/src/message_table_cell_with_message.cpp +++ b/escher/src/message_table_cell_with_message.cpp @@ -25,7 +25,7 @@ View * MessageTableCellWithMessage::accessoryView() const { void MessageTableCellWithMessage::setHighlighted(bool highlight) { MessageTableCell::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted()? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; m_accessoryView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/nested_menu_controller.cpp b/escher/src/nested_menu_controller.cpp index 651175a3f..0c5f014a2 100644 --- a/escher/src/nested_menu_controller.cpp +++ b/escher/src/nested_menu_controller.cpp @@ -89,7 +89,7 @@ void NestedMenuController::ListController::setFirstSelectedRow(int firstSelected /* NestedMenuController */ NestedMenuController::NestedMenuController(Responder * parentResponder, I18n::Message title) : - StackViewController(parentResponder, &m_listController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleDark), + StackViewController(parentResponder, &m_listController, Palette::ToolboxHeaderText, Palette::ToolboxHeaderBackground, Palette::ToolboxHeaderBorder), m_selectableTableView(&m_listController, this, this), m_listController(this, &m_selectableTableView, title), m_sender(nullptr) diff --git a/escher/src/palette.cpp b/escher/src/palette.cpp index 081fbf6bd..8e2f2e401 100644 --- a/escher/src/palette.cpp +++ b/escher/src/palette.cpp @@ -1,7 +1,76 @@ #include -constexpr KDColor Palette::Text; +constexpr KDColor Palette::PrimaryText; +constexpr KDColor Palette::SecondaryText; // =GREYDARK constexpr KDColor Palette::BackgroundHard; +constexpr KDColor Palette::BackgroundApps; +constexpr KDColor Palette::Toolbar; +constexpr KDColor Palette::ToolbarText; +constexpr KDColor Palette::ExpressionInputBackground; + +constexpr KDColor Palette::Control; +constexpr KDColor Palette::ControlEnabled; +constexpr KDColor Palette::ControlDisabled; + +constexpr KDColor Palette::CalculationBackgroundOdd; +constexpr KDColor Palette::CalculationBackgroundEven; + +constexpr KDColor Palette::CodeBackground; +constexpr KDColor Palette::CodeBackgroundSelected; +constexpr KDColor Palette::CodeText; +constexpr KDColor Palette::CodeComment; +constexpr KDColor Palette::CodeNumber; +constexpr KDColor Palette::CodeKeyword; +constexpr KDColor Palette::CodeOperator; +constexpr KDColor Palette::CodeString; + +constexpr KDColor Palette::SubMenuBackground; +constexpr KDColor Palette::SubMenuBorder; +constexpr KDColor Palette::SubMenuText; + +constexpr KDColor Palette::ToolboxHeaderBackground; +constexpr KDColor Palette::ToolboxHeaderText; +constexpr KDColor Palette::ToolboxHeaderBorder; +constexpr KDColor Palette::ToolboxBackground; + +constexpr KDColor Palette::ListCellBackground; +constexpr KDColor Palette::ListCellBackgroundSelected; +constexpr KDColor Palette::ListCellBorder; + +constexpr KDColor Palette::ButtonBackground; +constexpr KDColor Palette::ButtonBackgroundSelected; +constexpr KDColor Palette::ButtonBackgroundSelectedHighContrast; +constexpr KDColor Palette::ButtonBorder; +constexpr KDColor Palette::ButtonShadow; +constexpr KDColor Palette::ButtonText; + +constexpr KDColor Palette::TabBackground; +constexpr KDColor Palette::TabBackgroundSelected; +constexpr KDColor Palette::TabBackgroundActive; +constexpr KDColor Palette::TabBackgroundSelectedAndActive; +constexpr KDColor Palette::TabText; +constexpr KDColor Palette::TabTextActive; + +constexpr KDColor Palette::SubTabBackground; +constexpr KDColor Palette::SubTabBackgroundSelected; +constexpr KDColor Palette::SubTabText; + +constexpr KDColor Palette::BannerFirstBackground; +constexpr KDColor Palette::BannerFirstBorder; +constexpr KDColor Palette::BannerFirstText; +constexpr KDColor Palette::BannerFirstVariantBackground; +constexpr KDColor Palette::BannerFirstVariantBorder; +constexpr KDColor Palette::BannerFirstVariantText; +constexpr KDColor Palette::BannerSecondBackground; +constexpr KDColor Palette::BannerSecondBorder; +constexpr KDColor Palette::BannerSecondText; + +constexpr KDColor Palette::HomeBackground; +constexpr KDColor Palette::HomeCellBackground; +constexpr KDColor Palette::HomeCellBackgroundActive; +constexpr KDColor Palette::HomeCellText; +constexpr KDColor Palette::HomeCellTextActive; + constexpr KDColor Palette::YellowDark; constexpr KDColor Palette::YellowLight; constexpr KDColor Palette::PurpleBright; diff --git a/escher/src/scroll_view.cpp b/escher/src/scroll_view.cpp index e6947cde7..13a0aa0ab 100644 --- a/escher/src/scroll_view.cpp +++ b/escher/src/scroll_view.cpp @@ -18,7 +18,7 @@ ScrollView::ScrollView(View * contentView, ScrollViewDataSource * dataSource) : m_leftMargin(0), m_innerView(this), m_decorators(), - m_backgroundColor(Palette::WallScreen) + m_backgroundColor(Palette::BackgroundApps) { assert(m_dataSource != nullptr); setDecoratorType(Decorator::Type::Bars); diff --git a/escher/src/scroll_view_indicator.cpp b/escher/src/scroll_view_indicator.cpp index be36a152b..6c7623cf8 100644 --- a/escher/src/scroll_view_indicator.cpp +++ b/escher/src/scroll_view_indicator.cpp @@ -7,7 +7,7 @@ extern "C" { ScrollViewIndicator::ScrollViewIndicator() : View(), - m_color(Palette::GreyDark), + m_color(Palette::SecondaryText), m_margin(14) { } diff --git a/escher/src/switch_view.cpp b/escher/src/switch_view.cpp index 4a3f51bd9..90b009047 100644 --- a/escher/src/switch_view.cpp +++ b/escher/src/switch_view.cpp @@ -56,12 +56,12 @@ void SwitchView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate heightCenter = bounds().height()/2; KDCoordinate switchHalfHeight = k_switchHeight/2; - KDColor mainColor = m_state ? Palette::YellowDark : Palette::GreyDark; + KDColor mainColor = m_state ? Palette::Control : Palette::ControlDisabled; KDRect frame(width - k_switchWidth, heightCenter -switchHalfHeight, k_switchWidth, k_switchHeight); ctx->blendRectWithMask(frame, mainColor, (const uint8_t *)switchMask, s_switchWorkingBuffer); KDCoordinate onOffX = width - (m_state ? k_onOffSize : k_switchWidth); KDRect onOffFrame(onOffX, heightCenter -switchHalfHeight, k_onOffSize, k_onOffSize); - ctx->blendRectWithMask(onOffFrame, Palette::BackgroundHard, (const uint8_t *)onOffMask, s_switchWorkingBuffer); + ctx->blendRectWithMask(onOffFrame, Palette::ListCellBackground, (const uint8_t *)onOffMask, s_switchWorkingBuffer); } KDSize SwitchView::minimalSizeForOptimalDisplay() const { diff --git a/escher/src/tab_view_cell.cpp b/escher/src/tab_view_cell.cpp index 9ae33126c..63e0c7d1a 100644 --- a/escher/src/tab_view_cell.cpp +++ b/escher/src/tab_view_cell.cpp @@ -35,13 +35,13 @@ void TabViewCell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate height = bounds().height(); KDCoordinate width = bounds().width(); // choose the background color - KDColor text = m_active ? Palette::PurpleBright : Palette::BackgroundHard; - KDColor background = m_active ? Palette::BackgroundHard : Palette::PurpleBright; - KDColor selection = m_active ? Palette::Select : Palette::SelectDark; + KDColor text = m_active ? Palette::TabTextActive : Palette::TabText; + KDColor background = m_active ? Palette::TabBackgroundActive : Palette::TabBackground; + KDColor selection = m_active ? Palette::TabBackgroundSelectedAndActive : Palette::TabBackgroundSelected; background = m_selected ? selection : background; // Color the background according to the state of the tab cell if (m_active || m_selected) { - ctx->fillRect(KDRect(0, 0, width, 1), Palette::PurpleBright); + ctx->fillRect(KDRect(0, 0, width, 1), Palette::TabBackgroundSelected); ctx->fillRect(KDRect(0, 1, width, height-1), background); } else { ctx->fillRect(KDRect(0, 0, width, height), background); diff --git a/escher/src/table_cell.cpp b/escher/src/table_cell.cpp index 89d10acab..6a14efc94 100644 --- a/escher/src/table_cell.cpp +++ b/escher/src/table_cell.cpp @@ -104,11 +104,11 @@ void TableCell::layoutSubviews() { void TableCell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - KDColor backgroundColor = isHighlighted() ? Palette::Select : Palette::BackgroundHard; + KDColor backgroundColor = isHighlighted() ? Palette::ListCellBackgroundSelected : Palette::ListCellBackground; ctx->fillRect(KDRect(k_separatorThickness, k_separatorThickness, width-2*k_separatorThickness, height-k_separatorThickness), backgroundColor); // Draw rectangle around cell - 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); - ctx->fillRect(KDRect(0, height-k_separatorThickness, width, k_separatorThickness), Palette::GreyBright); + ctx->fillRect(KDRect(0, 0, width, k_separatorThickness), Palette::ListCellBorder); + ctx->fillRect(KDRect(0, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::ListCellBorder); + ctx->fillRect(KDRect(width-k_separatorThickness, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::ListCellBorder); + ctx->fillRect(KDRect(0, height-k_separatorThickness, width, k_separatorThickness), Palette::ListCellBorder); } diff --git a/escher/src/text_cursor_view.cpp b/escher/src/text_cursor_view.cpp index c1b57dc2b..437742157 100644 --- a/escher/src/text_cursor_view.cpp +++ b/escher/src/text_cursor_view.cpp @@ -3,7 +3,7 @@ void TextCursorView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate height = bounds().height(); - ctx->fillRect(KDRect(0, 0, 1, height), Palette::Text); + ctx->fillRect(KDRect(0, 0, 1, height), Palette::PrimaryText); } KDSize TextCursorView::minimalSizeForOptimalDisplay() const { diff --git a/escher/src/toolbox.cpp b/escher/src/toolbox.cpp index c2ebf0603..7bb368be7 100644 --- a/escher/src/toolbox.cpp +++ b/escher/src/toolbox.cpp @@ -30,7 +30,7 @@ void Toolbox::willDisplayCellForIndex(HighlightCell * cell, int index) { MessageTableCellWithMessage * myCell = (MessageTableCellWithMessage *)cell; myCell->setMessage(messageTree->label()); myCell->setAccessoryMessage(messageTree->text()); - myCell->setAccessoryTextColor(Palette::GreyDark); + myCell->setAccessoryTextColor(Palette::SecondaryText); return; } MessageTableCell * myCell = (MessageTableCell *)cell; diff --git a/escher/src/warning_controller.cpp b/escher/src/warning_controller.cpp index 4f01de1c2..35fe3b2dc 100644 --- a/escher/src/warning_controller.cpp +++ b/escher/src/warning_controller.cpp @@ -5,8 +5,8 @@ static inline KDCoordinate maxCoordinate(KDCoordinate x, KDCoordinate y) { retur WarningController::ContentView::ContentView() : SolidColorView(KDColorBlack), - m_textView1(KDFont::SmallFont, (I18n::Message)0, k_middleAlignment, k_middleAlignment, Palette::BackgroundHard, Palette::Text), - m_textView2(KDFont::SmallFont, (I18n::Message)0, k_middleAlignment, (1.0f-k_shiftedAlignment), Palette::BackgroundHard, Palette::Text) + m_textView1(KDFont::SmallFont, (I18n::Message)0, k_middleAlignment, k_middleAlignment, Palette::BackgroundHard, Palette::PrimaryText), + m_textView2(KDFont::SmallFont, (I18n::Message)0, k_middleAlignment, (1.0f-k_shiftedAlignment), Palette::BackgroundHard, Palette::PrimaryText) { } diff --git a/poincare/include/poincare/layout_node.h b/poincare/include/poincare/layout_node.h index 113d192ce..767fddec0 100644 --- a/poincare/include/poincare/layout_node.h +++ b/poincare/include/poincare/layout_node.h @@ -61,7 +61,7 @@ public: bool isIdenticalTo(Layout l); // Rendering - void draw(KDContext * ctx, KDPoint p, KDColor expressionColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); + void draw(KDContext * ctx, KDPoint p, KDColor expressionColor = Palette::PrimaryText, KDColor backgroundColor = Palette::BackgroundHard); KDPoint origin(); KDPoint absoluteOrigin(); KDSize layoutSize();