diff --git a/apps/calculation/history_view_cell.cpp b/apps/calculation/history_view_cell.cpp index a28d2c477..0ca0b4bc6 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 ? KDColorWhite : Palette::WallScreen; + KDColor background = m_even ? Palette::BackgroundHard : Palette::WallScreen; return background; } diff --git a/apps/code/console_controller.cpp b/apps/code/console_controller.cpp index 1041630f9..724ffeb76 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(KDColorWhite); + m_selectableTableView.setBackgroundColor(Palette::BackgroundHard); 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 b0181b6a0..383f3d3f2 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(), KDColorWhite); - ctx->drawString(m_line->text(), KDPointZero, ConsoleController::k_font, textColor(m_line), isHighlighted()? Palette::Select : KDColorWhite); + ctx->fillRect(bounds(), Palette::BackgroundHard); + ctx->drawString(m_line->text(), KDPointZero, ConsoleController::k_font, textColor(m_line), isHighlighted()? Palette::Select : Palette::BackgroundHard); } KDSize ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::minimalSizeForOptimalDisplay() const { diff --git a/apps/code/python_text_area.cpp b/apps/code/python_text_area.cpp index 4c76b59ef..1f6f3e31d 100644 --- a/apps/code/python_text_area.cpp +++ b/apps/code/python_text_area.cpp @@ -16,7 +16,7 @@ constexpr KDColor KeywordColor = KDColor::RGB24(0xFF000C); // constexpr KDColor BuiltinColor = KDColor::RGB24(0x0086B3); constexpr KDColor OperatorColor = KDColor::RGB24(0xd73a49); constexpr KDColor StringColor = KDColor::RGB24(0x032f62); -constexpr KDColor BackgroundColor = KDColorWhite; +constexpr KDColor BackgroundColor = Palette::BackgroundHard; static inline const char * minPointer(const char * x, const char * y) { return x < y ? x : y; } diff --git a/apps/code/sandbox_controller.cpp b/apps/code/sandbox_controller.cpp index 5b056c53b..d79355c3d 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(KDColorWhite), + m_solidColorView(Palette::BackgroundHard), m_executionEnvironment(executionEnvironment) { assert(executionEnvironment != nullptr); diff --git a/apps/code/script_node_cell.cpp b/apps/code/script_node_cell.cpp index 865275734..667692e9f 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 : KDColorWhite); + ctx->drawString(m_scriptNode->name(), KDPoint(0, Metric::TableCellLabelTopMargin), k_font, Palette::Text, isHighlighted()? Palette::Select : Palette::BackgroundHard); 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 : KDColorWhite); + ctx->drawString(ScriptNodeCell::k_parentheses, KDPoint(nameSize.width(), Metric::TableCellLabelTopMargin), k_font, Palette::Text, 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::GreyDark, isHighlighted()? Palette::Select : KDColorWhite); + 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); } KDSize ScriptNodeCell::ScriptNodeView::minimalSizeForOptimalDisplay() const { 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 ef46e8ca8..86783b640 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 @@ -18,7 +18,7 @@ public: float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, KDColor textColor = Palette::Text, - KDColor backgroundColor = KDColorWhite) : + 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 a96f65a1c..387cdb155 100644 --- a/apps/hardware_test/arrow_view.cpp +++ b/apps/hardware_test/arrow_view.cpp @@ -51,7 +51,7 @@ void ArrowView::setColor(KDColor color) { KDColor s_arrowWorkingBuffer[10*9]; void ArrowView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), KDColorWhite); + ctx->fillRect(bounds(), Palette::BackgroundHard); KDCoordinate startLine = m_directionIsUp ? k_arrowHeight : 0; KDCoordinate startArrow = m_directionIsUp ? 0 : bounds().height()-k_arrowHeight; ctx->fillRect(KDRect((Ion::Display::Width-k_arrowThickness)/2, startLine, k_arrowThickness, bounds().height()-k_arrowHeight), m_color); diff --git a/apps/home/app_cell.cpp b/apps/home/app_cell.cpp index b32d8e920..6d1b8ed96 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, KDColorWhite), + m_nameView(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::Text, Palette::BackgroundHard), 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), KDColorWhite); + ctx->fillRect(KDRect(0, bounds().height()-nameSize.height() - 2*k_nameHeightMargin, bounds().width(), nameSize.height()+2*k_nameHeightMargin), Palette::BackgroundHard); } int AppCell::numberOfSubviews() const { @@ -45,8 +45,8 @@ void AppCell::setVisible(bool visible) { } void AppCell::reloadCell() { - m_nameView.setTextColor(isHighlighted() ? KDColorWhite : Palette::Text); - m_nameView.setBackgroundColor(isHighlighted() ? Palette::YellowDark : KDColorWhite); + m_nameView.setTextColor(isHighlighted() ? Palette::BackgroundHard : Palette::Text); + m_nameView.setBackgroundColor(isHighlighted() ? Palette::YellowDark : Palette::BackgroundHard); } } diff --git a/apps/home/controller.cpp b/apps/home/controller.cpp index 42a657398..22affba46 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(KDColorWhite); + m_selectableTableView.setBackgroundColor(Palette::BackgroundHard); 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(), KDColorWhite); + ctx->fillRect(bounds(), Palette::BackgroundHard); } void Controller::ContentView::reloadBottomRow(SimpleTableViewDataSource * dataSource, int numberOfIcons, int numberOfColumns) { diff --git a/apps/lock_view.cpp b/apps/lock_view.cpp index ed41abc72..0aa02fdd7 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, KDColorWhite, (const uint8_t *)lockMask, s_lockWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::BackgroundHard, (const uint8_t *)lockMask, s_lockWorkingBuffer); } KDSize LockView::minimalSizeForOptimalDisplay() const { diff --git a/apps/on_boarding/logo_view.cpp b/apps/on_boarding/logo_view.cpp index 2756012b0..84b142f7c 100644 --- a/apps/on_boarding/logo_view.cpp +++ b/apps/on_boarding/logo_view.cpp @@ -11,7 +11,7 @@ LogoView::LogoView() : } void LogoView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), KDColorWhite); + ctx->fillRect(bounds(), Palette::BackgroundHard); } int LogoView::numberOfSubviews() const { diff --git a/apps/probability/app.cpp b/apps/probability/app.cpp index 7b840ce50..f3bb0120e 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, KDColorWhite, Palette::PurpleBright, Palette::PurpleBright); + m_stackViewController.push(&m_parametersController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); break; case Snapshot::Page::Calculations: - m_stackViewController.push(&m_parametersController, KDColorWhite, Palette::PurpleBright, Palette::PurpleBright); - m_stackViewController.push(&m_calculationController, KDColorWhite, Palette::SubTab, Palette::SubTab); + m_stackViewController.push(&m_parametersController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); + m_stackViewController.push(&m_calculationController, Palette::BackgroundHard, Palette::SubTab, Palette::SubTab); default: break; } diff --git a/apps/probability/calculation_cell.cpp b/apps/probability/calculation_cell.cpp index ed1981723..d7db3182a 100644 --- a/apps/probability/calculation_cell.cpp +++ b/apps/probability/calculation_cell.cpp @@ -40,7 +40,7 @@ KDSize CalculationCell::minimalSizeForOptimalDisplay() const { } void CalculationCell::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), KDColorWhite); + ctx->fillRect(bounds(), Palette::BackgroundHard); if (m_isResponder) { KDSize textSize = m_text.minimalSizeForOptimalDisplay(); ctx->strokeRect(KDRect(2*k_margin+textSize.width(), 0, calculationCellWidth()+2*ResponderImageCell::k_outline, ImageCell::k_height+2*ResponderImageCell::k_outline), Palette::GreyMiddle); diff --git a/apps/probability/calculation_controller.cpp b/apps/probability/calculation_controller.cpp index 1c2a1b097..9d37b2d50 100644 --- a/apps/probability/calculation_controller.cpp +++ b/apps/probability/calculation_controller.cpp @@ -67,7 +67,7 @@ CalculationController::CalculationController(Responder * parentResponder, InputE m_selectableTableView.setMargins(k_tableMargin); m_selectableTableView.setVerticalCellOverlap(0); m_selectableTableView.setDecoratorType(ScrollView::Decorator::Type::None); - m_selectableTableView.setBackgroundColor(KDColorWhite); + m_selectableTableView.setBackgroundColor(Palette::BackgroundHard); for (int i = 0; i < k_numberOfCalculationCells; i++) { diff --git a/apps/probability/cell.cpp b/apps/probability/cell.cpp index b3cb6f019..5e89a364f 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, KDColorWhite), + m_labelView(KDFont::LargeFont, (I18n::Message)0, 0, 0.5, Palette::Text, 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 : KDColorWhite; + KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; 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 : KDColorWhite; + KDColor backgroundColor = isHighlighted() ? Palette::Select : Palette::BackgroundHard; 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 ec89a49ac..5238181a3 100644 --- a/apps/probability/distribution_controller.cpp +++ b/apps/probability/distribution_controller.cpp @@ -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, KDColorWhite, Palette::PurpleBright, Palette::PurpleBright); + stack->push(m_parametersController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); return true; } return false; diff --git a/apps/probability/parameters_controller.cpp b/apps/probability/parameters_controller.cpp index c06bfc283..f59f02e3c 100644 --- a/apps/probability/parameters_controller.cpp +++ b/apps/probability/parameters_controller.cpp @@ -161,7 +161,7 @@ bool ParametersController::textFieldDidFinishEditing(TextField * textField, cons void ParametersController::buttonAction() { StackViewController * stack = stackController(); - stack->push(m_calculationController, KDColorWhite, Palette::SubTab, Palette::SubTab); + stack->push(m_calculationController, Palette::BackgroundHard, Palette::SubTab, Palette::SubTab); } } diff --git a/apps/probability/responder_image_cell.cpp b/apps/probability/responder_image_cell.cpp index a23b65309..f50e98d84 100644 --- a/apps/probability/responder_image_cell.cpp +++ b/apps/probability/responder_image_cell.cpp @@ -11,7 +11,7 @@ ResponderImageCell::ResponderImageCell(Responder * parentResponder, Distribution } void ResponderImageCell::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), KDColorWhite); + ctx->fillRect(bounds(), Palette::BackgroundHard); ctx->strokeRect(KDRect(0, 0, ImageCell::k_width+2*k_outline, ImageCell::k_height+2*k_outline), Palette::GreyMiddle); } diff --git a/apps/regression/graph_view.cpp b/apps/regression/graph_view.cpp index e1d31d590..1cbc69252 100644 --- a/apps/regression/graph_view.cpp +++ b/apps/regression/graph_view.cpp @@ -17,7 +17,7 @@ GraphView::GraphView(Store * store, CurveViewCursor * cursor, BannerView * banne } void GraphView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(rect, KDColorWhite); + ctx->fillRect(rect, Palette::BackgroundHard); drawGrid(ctx, rect); drawAxes(ctx, rect); simpleDrawBothAxesLabels(ctx, rect); @@ -36,7 +36,7 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const { drawDot(ctx, rect, m_store->get(series, 0, index), m_store->get(series, 1, index), color); } drawDot(ctx, rect, m_store->meanOfColumn(series, 0), m_store->meanOfColumn(series, 1), color, true); - drawDot(ctx, rect, m_store->meanOfColumn(series, 0), m_store->meanOfColumn(series, 1), KDColorWhite); + drawDot(ctx, rect, m_store->meanOfColumn(series, 0), m_store->meanOfColumn(series, 1), Palette::BackgroundHard); } } } diff --git a/apps/sequence/list/list_controller.cpp b/apps/sequence/list/list_controller.cpp index a1c96f37c..932060708 100644 --- a/apps/sequence/list/list_controller.cpp +++ b/apps/sequence/list/list_controller.cpp @@ -15,7 +15,7 @@ ListController::ListController(Responder * parentResponder, ::InputEventHandlerD m_expressionCells{}, m_parameterController(inputEventHandlerDelegate, this), m_typeParameterController(this, this, TableCell::Layout::Vertical), - m_typeStackController(nullptr, &m_typeParameterController, KDColorWhite, Palette::PurpleDark, Palette::PurpleDark), + m_typeStackController(nullptr, &m_typeParameterController, Palette::BackgroundHard, Palette::PurpleDark, Palette::PurpleDark), m_sequenceToolbox() { for (int i = 0; i < k_maxNumberOfRows; i++) { diff --git a/apps/shared/buffer_text_view_with_text_field.cpp b/apps/shared/buffer_text_view_with_text_field.cpp index 78aff5867..2f37c4a92 100644 --- a/apps/shared/buffer_text_view_with_text_field.cpp +++ b/apps/shared/buffer_text_view_with_text_field.cpp @@ -24,14 +24,14 @@ void BufferTextViewWithTextField::drawRect(KDContext * ctx, KDRect rect) const { // Fill margins with white // Left margin - ctx->fillRect(KDRect(0, 0, Metric::TitleBarExternHorizontalMargin, bounds().height()), KDColorWhite); - ctx->fillRect(KDRect(bounds().width() - Metric::TitleBarExternHorizontalMargin, 0, Metric::TitleBarExternHorizontalMargin, bounds().height()), KDColorWhite); + ctx->fillRect(KDRect(0, 0, Metric::TitleBarExternHorizontalMargin, bounds().height()), Palette::BackgroundHard); + ctx->fillRect(KDRect(bounds().width() - Metric::TitleBarExternHorizontalMargin, 0, Metric::TitleBarExternHorizontalMargin, bounds().height()), Palette::BackgroundHard); // Right margin - ctx->fillRect(KDRect(bounds().width() - Metric::TitleBarExternHorizontalMargin, 0, Metric::TitleBarExternHorizontalMargin, bounds().height()), KDColorWhite); + ctx->fillRect(KDRect(bounds().width() - Metric::TitleBarExternHorizontalMargin, 0, Metric::TitleBarExternHorizontalMargin, bounds().height()), Palette::BackgroundHard); // Above the text field - ctx->fillRect(KDRect(textFieldRect.x() - k_borderWidth, 0, textFieldRect.width() + 2*k_borderWidth, bounds().height()), KDColorWhite); + ctx->fillRect(KDRect(textFieldRect.x() - k_borderWidth, 0, textFieldRect.width() + 2*k_borderWidth, bounds().height()), Palette::BackgroundHard); // Under the text field - ctx->fillRect(KDRect(textFieldRect.x() - k_borderWidth, textFieldRect.bottom() + k_borderWidth, textFieldRect.width() + 2*k_borderWidth, bounds().height()), KDColorWhite); + ctx->fillRect(KDRect(textFieldRect.x() - k_borderWidth, textFieldRect.bottom() + k_borderWidth, textFieldRect.width() + 2*k_borderWidth, bounds().height()), Palette::BackgroundHard); // Draw the text field border KDRect borderRect = KDRect(textFieldRect.x()-k_borderWidth, textFieldRect.y()-k_borderWidth, textFieldRect.width()+2*k_borderWidth, textFieldRect.height()+2*k_borderWidth); diff --git a/apps/shared/curve_view.h b/apps/shared/curve_view.h index 1c4ac72b8..21f219d94 100644 --- a/apps/shared/curve_view.h +++ b/apps/shared/curve_view.h @@ -72,7 +72,7 @@ protected: bool fillBar, KDColor defaultColor, KDColor highlightColor, float highlightLowerBound = INFINITY, float highlightUpperBound = -INFINITY) const; void computeLabels(Axis axis); void simpleDrawBothAxesLabels(KDContext * ctx, KDRect rect) const; - void drawLabels(KDContext * ctx, KDRect rect, Axis axis, bool shiftOrigin, bool graduationOnly = false, bool fixCoordinate = false, KDCoordinate fixedCoordinate = 0, KDColor backgroundColor = KDColorWhite) const; + void drawLabels(KDContext * ctx, KDRect rect, Axis axis, bool shiftOrigin, bool graduationOnly = false, bool fixCoordinate = false, KDCoordinate fixedCoordinate = 0, KDColor backgroundColor = Palette::BackgroundHard) const; View * m_bannerView; CurveViewCursor * m_curveViewCursor; private: diff --git a/apps/shared/function_expression_cell.cpp b/apps/shared/function_expression_cell.cpp index 950ccc2a3..628040440 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 : KDColorWhite; + KDColor separatorColor = m_even ? Palette::WallScreen : 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_graph_view.cpp b/apps/shared/function_graph_view.cpp index ee8cd73fc..552cf1be1 100644 --- a/apps/shared/function_graph_view.cpp +++ b/apps/shared/function_graph_view.cpp @@ -20,7 +20,7 @@ FunctionGraphView::FunctionGraphView(InteractiveCurveViewRange * graphRange, } void FunctionGraphView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(rect, KDColorWhite); + ctx->fillRect(rect, Palette::BackgroundHard); drawGrid(ctx, rect); drawAxes(ctx, rect); simpleDrawBothAxesLabels(ctx, rect); diff --git a/apps/shared/function_title_cell.cpp b/apps/shared/function_title_cell.cpp index 17e640e3c..10cb1150a 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 : KDColorWhite; - KDColor backgroundColor = m_even ? KDColorWhite : Palette::WallScreen; + KDColor separatorColor = m_even ? Palette::WallScreen : Palette::BackgroundHard; + KDColor backgroundColor = m_even ? Palette::BackgroundHard : Palette::WallScreen; // Draw the color indicator ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), m_functionColor); // Draw the horizontal separator diff --git a/apps/shared/message_view.cpp b/apps/shared/message_view.cpp index 8b5396ee3..5a805f244 100644 --- a/apps/shared/message_view.cpp +++ b/apps/shared/message_view.cpp @@ -12,7 +12,7 @@ MessageView::MessageView(I18n::Message * messages, KDColor * colors, uint8_t num } void MessageView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), KDColorWhite); + ctx->fillRect(bounds(), Palette::BackgroundHard); } View * MessageView::subviewAtIndex(int index) { diff --git a/apps/shared/scrollable_exact_approximate_expressions_view.cpp b/apps/shared/scrollable_exact_approximate_expressions_view.cpp index 59df3b3f7..c0106c110 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 ? KDColorWhite : Palette::WallScreen; + KDColor background = m_even ? Palette::BackgroundHard : Palette::WallScreen; return background; } diff --git a/apps/shared/text_field_with_extension.h b/apps/shared/text_field_with_extension.h index 9a1a89eac..6fca0a1fb 100644 --- a/apps/shared/text_field_with_extension.h +++ b/apps/shared/text_field_with_extension.h @@ -18,7 +18,7 @@ public: float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, KDColor textColor = Palette::Text, - KDColor backgroundColor = KDColorWhite) : + KDColor backgroundColor = Palette::BackgroundHard) : TextField(parentResponder, textBuffer, textBufferSize, draftTextBufferSize, inputEventHandlerDelegate, delegate, size, horizontalAlignment, verticalAlignment, textColor, backgroundColor), m_extensionLength(extensionLength) {} diff --git a/apps/shift_alpha_lock_view.cpp b/apps/shift_alpha_lock_view.cpp index ae811e1d3..3a444eda0 100644 --- a/apps/shift_alpha_lock_view.cpp +++ b/apps/shift_alpha_lock_view.cpp @@ -2,7 +2,7 @@ ShiftAlphaLockView::ShiftAlphaLockView() : View(), - m_shiftAlphaView(KDFont::SmallFont, I18n::Message::Default, 1.0f, 0.5f, KDColorWhite, Palette::YellowDark), + m_shiftAlphaView(KDFont::SmallFont, I18n::Message::Default, 1.0f, 0.5f, Palette::BackgroundHard, Palette::YellowDark), m_status(Ion::Events::ShiftAlphaStatus::Default) { } diff --git a/apps/solver/equation_list_view.cpp b/apps/solver/equation_list_view.cpp index 6c08a2da8..02709caec 100644 --- a/apps/solver/equation_list_view.cpp +++ b/apps/solver/equation_list_view.cpp @@ -19,7 +19,7 @@ EquationListView::EquationListView(ListController * listController) : listController->setScrollViewDelegate(this); m_scrollBraceView.setMargins(k_margin, k_margin, k_margin, k_margin); m_scrollBraceView.setDecoratorType(ScrollView::Decorator::Type::None); - m_scrollBraceView.setBackgroundColor(KDColorWhite); + m_scrollBraceView.setBackgroundColor(Palette::BackgroundHard); } void EquationListView::setBraceStyle(BraceStyle style) { @@ -108,7 +108,7 @@ const uint8_t bottomBrace[braceExtremumHeight][braceExtremumWidth] = { KDColor s_braceWorkingBuffer[60]; void EquationListView::BraceView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(bounds(), KDColorWhite); + 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)); diff --git a/apps/solver/interval_controller.cpp b/apps/solver/interval_controller.cpp index 7d10ab474..d4cdb2a97 100644 --- a/apps/solver/interval_controller.cpp +++ b/apps/solver/interval_controller.cpp @@ -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(), KDColorWhite, Palette::SubTab, Palette::SubTab); + stack->push(App::app()->solutionsControllerStack(), Palette::BackgroundHard, Palette::SubTab, Palette::SubTab); } } diff --git a/apps/solver/list_controller.cpp b/apps/solver/list_controller.cpp index 33c860690..af83ee444 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, KDColorWhite, Palette::PurpleDark, Palette::PurpleDark) + m_modelsStackController(nullptr, &m_modelsParameterController, Palette::BackgroundHard, Palette::PurpleDark, Palette::PurpleDark) { 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(), KDColorWhite, Palette::PurpleBright, Palette::PurpleBright); + stack->push(App::app()->intervalController(), Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); return; } default: { assert(e == EquationStore::Error::NoError); StackViewController * stack = stackController(); - stack->push(App::app()->solutionsControllerStack(), KDColorWhite, Palette::PurpleBright, Palette::PurpleBright); + stack->push(App::app()->solutionsControllerStack(), Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleBright); } } } diff --git a/apps/statistics/box_axis_view.cpp b/apps/statistics/box_axis_view.cpp index fdc270c6d..74a987bc7 100644 --- a/apps/statistics/box_axis_view.cpp +++ b/apps/statistics/box_axis_view.cpp @@ -6,7 +6,7 @@ using namespace Shared; namespace Statistics { void BoxAxisView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(rect, KDColorWhite); + ctx->fillRect(rect, Palette::BackgroundHard); KDRect lineRect = KDRect(0, k_axisMargin, bounds().width(), 1); ctx->fillRect(lineRect, Palette::Text); 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 a5882ae51..0e2ee15f8 100644 --- a/apps/statistics/box_view.cpp +++ b/apps/statistics/box_view.cpp @@ -52,7 +52,7 @@ void BoxView::reload() { } void BoxView::drawRect(KDContext * ctx, KDRect rect) const { - ctx->fillRect(rect, KDColorWhite); + ctx->fillRect(rect, Palette::BackgroundHard); KDCoordinate lowBoundPixel = boxLowerBoundPixel(); KDCoordinate upBoundPixel = boxUpperBoundPixel(); diff --git a/apps/statistics/histogram_view.cpp b/apps/statistics/histogram_view.cpp index 94b681aa2..7dca2421a 100644 --- a/apps/statistics/histogram_view.cpp +++ b/apps/statistics/histogram_view.cpp @@ -40,7 +40,7 @@ void HistogramView::reloadSelectedBar() { void HistogramView::drawRect(KDContext * ctx, KDRect rect) const { m_controller->setCurrentDrawnSeries(m_series); - ctx->fillRect(rect, KDColorWhite); + ctx->fillRect(rect, Palette::BackgroundHard); drawAxis(ctx, rect, Axis::Horizontal); drawLabels(ctx, rect, Axis::Horizontal, false, !m_displayLabels); /* We memoize the total size to avoid recomputing it in double precision at diff --git a/apps/statistics/multiple_data_view.cpp b/apps/statistics/multiple_data_view.cpp index 5caed52eb..37ea55931 100644 --- a/apps/statistics/multiple_data_view.cpp +++ b/apps/statistics/multiple_data_view.cpp @@ -112,7 +112,7 @@ void MultipleDataView::layoutBanner() { void MultipleDataView::drawRect(KDContext * ctx, KDRect rect) const { if (!m_displayBanner) { - ctx->fillRect(bannerFrame(), KDColorWhite); + ctx->fillRect(bannerFrame(), Palette::BackgroundHard); } } diff --git a/escher/include/escher/buffer_text_view.h b/escher/include/escher/buffer_text_view.h index 4a4d9de0c..2371de83c 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 = KDColorWhite); + KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); void setText(const char * text) override; const char * text() const override; void appendText(const char * text); diff --git a/escher/include/escher/editable_text_cell.h b/escher/include/escher/editable_text_cell.h index 7f7691146..b8c99049e 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 = KDColorWhite, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0); + 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); 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 ab19e8c4a..b18a195b2 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 = KDColorWhite); + KDColor textColor = Palette::Text, 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/expression_view.h b/escher/include/escher/expression_view.h index 7fd684f3d..5a7ab97bc 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 = KDColorWhite); + KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); 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_text_view.h b/escher/include/escher/message_text_view.h index 3adcd6c73..b1c89551b 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 = KDColorWhite); + KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); void setText(const char * text) override; void setMessage(I18n::Message message); const char * text() const override; diff --git a/escher/include/escher/pointer_text_view.h b/escher/include/escher/pointer_text_view.h index 45a3109c8..d3b163b8f 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 = KDColorWhite); + KDColor textColor = Palette::Text, 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 d72265a12..4fa3a3741 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 = KDColorWhite) : + KDColor textColor = Palette::Text, 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 7675072c4..96bb93cda 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 = KDColorWhite, KDColor separatorColor = Palette::GreyBright); + KDColor textColor = Palette::SubTab, KDColor backgroundColor = Palette::BackgroundHard, KDColor separatorColor = Palette::GreyBright); /* Push creates a new StackView and adds it */ - void push(ViewController * vc, KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GreyBright); + void push(ViewController * vc, KDColor textColor = Palette::SubTab, KDColor backgroundColor = Palette::BackgroundHard, KDColor separatorColor = Palette::GreyBright); void pop(); int depth(); @@ -27,7 +27,7 @@ public: private: class Frame { public: - Frame(ViewController * viewController = nullptr, KDColor textColor = Palette::SubTab, KDColor backgroundColor = KDColorWhite, KDColor separatorColor = Palette::GreyBright) : + Frame(ViewController * viewController = nullptr, KDColor textColor = Palette::SubTab, KDColor backgroundColor = Palette::BackgroundHard, KDColor separatorColor = Palette::GreyBright) : 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 288729d16..20477b774 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 = KDColorWhite); + KDColor textColor = Palette::Text, 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 d88039cb5..9c4fa1f70 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 = KDColorWhite) : + TextView(const KDFont * font = KDFont::LargeFont, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f, KDColor textColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard) : View(), m_font(font), m_horizontalAlignment(horizontalAlignment), diff --git a/escher/src/button.cpp b/escher/src/button.cpp index 3c9551f2e..68f65bfba 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() : KDColorWhite; + KDColor backgroundColor = highlight? highlightedBackgroundColor() : Palette::BackgroundHard; m_messageTextView.setBackgroundColor(backgroundColor); markRectAsDirty(bounds()); } diff --git a/escher/src/button_row_controller.cpp b/escher/src/button_row_controller.cpp index 479d1c140..9bf98681e 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), KDColorWhite); + ctx->fillRect(KDRect(0, 0, bounds().width(), k_plainStyleHeight), Palette::BackgroundHard); ctx->fillRect(KDRect(0, k_plainStyleHeight, bounds().width(), 1), Palette::GreyWhite); } else { - ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight, bounds().width(), k_plainStyleHeight), KDColorWhite); + ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight, bounds().width(), k_plainStyleHeight), Palette::BackgroundHard); ctx->fillRect(KDRect(0, bounds().height() - k_plainStyleHeight-1, bounds().width(), 1), Palette::GreyWhite); } return; diff --git a/escher/src/editable_text_cell.cpp b/escher/src/editable_text_cell.cpp index 98f47e1ad..23879f90f 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 : KDColorWhite; + KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; m_textField.setBackgroundColor(backgroundColor); } diff --git a/escher/src/even_odd_cell.cpp b/escher/src/even_odd_cell.cpp index 4e6b0bb9f..c3e3c5aef 100644 --- a/escher/src/even_odd_cell.cpp +++ b/escher/src/even_odd_cell.cpp @@ -16,7 +16,7 @@ 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 ? KDColorWhite : Palette::WallScreen ; + KDColor background = m_even ? Palette::BackgroundHard : Palette::WallScreen ; background = isHighlighted() ? Palette::Select : background; return background; } diff --git a/escher/src/even_odd_editable_text_cell.cpp b/escher/src/even_odd_editable_text_cell.cpp index 2d2fcaebc..24da5d1dd 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, KDColorWhite, topMargin, rightMargin, bottomMargin, leftMargin) + m_editableCell(this, inputEventHandlerDelegate, delegate, font, horizontalAlignment, verticalAlignment, Palette::Text, Palette::BackgroundHard, topMargin, rightMargin, bottomMargin, leftMargin) { } diff --git a/escher/src/expression_field.cpp b/escher/src/expression_field.cpp index fd1e62a35..3c0a92f17 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, KDColorWhite), + m_textField(parentResponder, nullptr, k_textFieldBufferSize, k_textFieldBufferSize, inputEventHandlerDelegate, textFieldDelegate, KDFont::LargeFont, 0.0f, 0.5f, Palette::Text, Palette::BackgroundHard), m_layoutField(parentResponder, inputEventHandlerDelegate, layoutFieldDelegate) { // Initialize text field m_textField.setMargins(0, k_horizontalMargin, 0, k_horizontalMargin); - m_textField.setBackgroundColor(KDColorWhite); + m_textField.setBackgroundColor(Palette::BackgroundHard); // Initialize layout field m_layoutField.setMargins(k_verticalMargin, k_horizontalMargin, k_verticalMargin, k_horizontalMargin); - m_layoutField.setBackgroundColor(KDColorWhite); + m_layoutField.setBackgroundColor(Palette::BackgroundHard); } void ExpressionField::setEditing(bool isEditing, bool reinitDraftBuffer) { diff --git a/escher/src/expression_table_cell.cpp b/escher/src/expression_table_cell.cpp index 12f76e418..5aad99c94 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, KDColorWhite) + m_labelExpressionView(0.0f, 0.5f, Palette::Text, Palette::BackgroundHard) { } @@ -14,7 +14,7 @@ View * ExpressionTableCell::labelView() const { void ExpressionTableCell::setHighlighted(bool highlight) { TableCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : KDColorWhite; + KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; 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 e8ba96a0a..9e5443300 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, KDColorWhite) + m_accessoryExpressionView(1.0f, 0.5f, Palette::GreyDark, Palette::BackgroundHard) {} 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 : KDColorWhite; + KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; 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 54dfaf133..40b877940 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, KDColorWhite) + m_accessoryView(KDFont::SmallFont, accessoryMessage, 0.0f, 0.5f, Palette::GreyDark, Palette::BackgroundHard) { 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 : KDColorWhite; + KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; m_accessoryView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/gauge_view.cpp b/escher/src/gauge_view.cpp index f22d7ecf6..c08c35b2c 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(KDColorWhite) + m_backgroundColor(Palette::BackgroundHard) { } diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index 769448640..bfe8b7304 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, KDColorWhite), + m_expressionView(0.0f, 0.5f, Palette::Text, Palette::BackgroundHard), m_cursorView(), m_isEditing(false) { diff --git a/escher/src/message_table_cell.cpp b/escher/src/message_table_cell.cpp index c990e1cf9..a1e63c5b4 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, KDColorWhite) + m_messageTextView(font, label, 0, 0.5, Palette::Text, Palette::BackgroundHard) { } @@ -14,7 +14,7 @@ View * MessageTableCell::labelView() const { void MessageTableCell::setHighlighted(bool highlight) { HighlightCell::setHighlighted(highlight); - KDColor backgroundColor = highlight? Palette::Select : KDColorWhite; + KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; 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 6a965e2f4..166a6073e 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 : KDColorWhite; + KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; 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 507ac5e82..366c60dd4 100644 --- a/escher/src/message_table_cell_with_chevron_and_buffer.cpp +++ b/escher/src/message_table_cell_with_chevron_and_buffer.cpp @@ -13,7 +13,7 @@ View * MessageTableCellWithChevronAndBuffer::subAccessoryView() const { void MessageTableCellWithChevronAndBuffer::setHighlighted(bool highlight) { MessageTableCellWithChevron::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; + KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; 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 01af387dd..e97dac6ed 100644 --- a/escher/src/message_table_cell_with_chevron_and_expression.cpp +++ b/escher/src/message_table_cell_with_chevron_and_expression.cpp @@ -15,7 +15,7 @@ View * MessageTableCellWithChevronAndExpression::subAccessoryView() const { void MessageTableCellWithChevronAndExpression::setHighlighted(bool highlight) { MessageTableCellWithChevron::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; + KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; 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 ff4d8a952..afa869da0 100644 --- a/escher/src/message_table_cell_with_chevron_and_message.cpp +++ b/escher/src/message_table_cell_with_chevron_and_message.cpp @@ -13,7 +13,7 @@ View * MessageTableCellWithChevronAndMessage::subAccessoryView() const { void MessageTableCellWithChevronAndMessage::setHighlighted(bool highlight) { MessageTableCellWithChevron::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; + KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; 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 64b1d1629..96977c9f0 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 : KDColorWhite; + KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; 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 144fa5c81..b1949e3bd 100644 --- a/escher/src/message_table_cell_with_expression.cpp +++ b/escher/src/message_table_cell_with_expression.cpp @@ -13,7 +13,7 @@ View * MessageTableCellWithExpression::accessoryView() const { void MessageTableCellWithExpression::setHighlighted(bool highlight) { MessageTableCell::setHighlighted(highlight); - KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite; + KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; 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 a7f28054c..9524daa02 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 : KDColorWhite; + KDColor backgroundColor = highlight? Palette::Select : Palette::BackgroundHard; 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 18cdc993c..4f4fc1740 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 : KDColorWhite; + KDColor backgroundColor = isHighlighted()? Palette::Select : Palette::BackgroundHard; m_accessoryView.setBackgroundColor(backgroundColor); } diff --git a/escher/src/nested_menu_controller.cpp b/escher/src/nested_menu_controller.cpp index d5a147f67..651175a3f 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, KDColorWhite, Palette::PurpleBright, Palette::PurpleDark), + StackViewController(parentResponder, &m_listController, Palette::BackgroundHard, Palette::PurpleBright, Palette::PurpleDark), 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 976990e75..918abdc6e 100644 --- a/escher/src/palette.cpp +++ b/escher/src/palette.cpp @@ -1,6 +1,7 @@ #include constexpr KDColor Palette::Text; +constexpr KDColor Palette::BackgroundHard; constexpr KDColor Palette::YellowDark; constexpr KDColor Palette::YellowLight; constexpr KDColor Palette::PurpleBright; diff --git a/escher/src/switch_view.cpp b/escher/src/switch_view.cpp index a88dfb7a0..4a3f51bd9 100644 --- a/escher/src/switch_view.cpp +++ b/escher/src/switch_view.cpp @@ -61,7 +61,7 @@ void SwitchView::drawRect(KDContext * ctx, KDRect rect) const { 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, KDColorWhite, (const uint8_t *)onOffMask, s_switchWorkingBuffer); + ctx->blendRectWithMask(onOffFrame, Palette::BackgroundHard, (const uint8_t *)onOffMask, s_switchWorkingBuffer); } KDSize SwitchView::minimalSizeForOptimalDisplay() const { diff --git a/escher/src/tab_view.cpp b/escher/src/tab_view.cpp index 46c458810..618c2b499 100644 --- a/escher/src/tab_view.cpp +++ b/escher/src/tab_view.cpp @@ -20,7 +20,7 @@ void TabView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate height = bounds().height(); KDCoordinate width = bounds().width(); // Draw a separator with the content - ctx->fillRect(KDRect(0, height-k_activeTabHeight, width, k_activeTabHeight), KDColorWhite); + ctx->fillRect(KDRect(0, height-k_activeTabHeight, width, k_activeTabHeight), Palette::BackgroundHard); } void TabView::addTab(ViewController * controller) { diff --git a/escher/src/tab_view_cell.cpp b/escher/src/tab_view_cell.cpp index 6b7167728..9ae33126c 100644 --- a/escher/src/tab_view_cell.cpp +++ b/escher/src/tab_view_cell.cpp @@ -35,8 +35,8 @@ 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 : KDColorWhite; - KDColor background = m_active ? KDColorWhite : Palette::PurpleBright; + KDColor text = m_active ? Palette::PurpleBright : Palette::BackgroundHard; + KDColor background = m_active ? Palette::BackgroundHard : Palette::PurpleBright; KDColor selection = m_active ? Palette::Select : Palette::SelectDark; background = m_selected ? selection : background; // Color the background according to the state of the tab cell diff --git a/escher/src/table_cell.cpp b/escher/src/table_cell.cpp index 14a2a3de3..89d10acab 100644 --- a/escher/src/table_cell.cpp +++ b/escher/src/table_cell.cpp @@ -104,7 +104,7 @@ void TableCell::layoutSubviews() { void TableCell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite; + KDColor backgroundColor = isHighlighted() ? Palette::Select : Palette::BackgroundHard; 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); diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index 78bf2dbe3..eddcc0df9 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -44,7 +44,7 @@ void TextField::ContentView::setTextColor(KDColor textColor) { void TextField::ContentView::drawRect(KDContext * ctx, KDRect rect) const { KDColor backgroundColor = m_backgroundColor; if (m_isEditing) { - backgroundColor = KDColorWhite; + backgroundColor = Palette::BackgroundHard; } ctx->fillRect(bounds(), backgroundColor); ctx->drawString(text(), glyphFrameAtPosition(text(), text()).origin(), m_font, m_textColor, backgroundColor); diff --git a/escher/src/warning_controller.cpp b/escher/src/warning_controller.cpp index 07bc18f22..4f01de1c2 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, KDColorWhite, KDColorBlack), - m_textView2(KDFont::SmallFont, (I18n::Message)0, k_middleAlignment, (1.0f-k_shiftedAlignment), KDColorWhite, 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) { } diff --git a/poincare/include/poincare/layout_node.h b/poincare/include/poincare/layout_node.h index 70fbad761..113d192ce 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 = KDColorWhite); + void draw(KDContext * ctx, KDPoint p, KDColor expressionColor = Palette::Text, KDColor backgroundColor = Palette::BackgroundHard); KDPoint origin(); KDPoint absoluteOrigin(); KDSize layoutSize(); diff --git a/themes b/themes index 3a30c39b9..02bdefe78 160000 --- a/themes +++ b/themes @@ -1 +1 @@ -Subproject commit 3a30c39b9d7b4040d950933ca093c804f8d456d1 +Subproject commit 02bdefe7857b191c22a377cfe515d090deff3e05