From cd604bcb5330ed1ec5769b7398b18802548f4ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Guid=C3=A9e?= Date: Fri, 29 Nov 2019 22:11:35 +0100 Subject: [PATCH] Omega Theme: some fixes --- apps/apps_container_prompt_beta.cpp | 2 +- apps/apps_container_prompt_update.cpp | 2 +- apps/battery_view.cpp | 20 +++++++++---------- apps/calculation/history_view_cell.cpp | 2 +- apps/probability/distribution_curve_view.cpp | 6 +++--- apps/sequence/list/list_controller.cpp | 2 +- ...ble_exact_approximate_expressions_view.cpp | 4 ++-- apps/solver/list_controller.cpp | 2 +- apps/statistics/box_view.cpp | 2 +- apps/statistics/histogram_view.h | 2 +- apps/usb/usb_connected_controller.cpp | 2 +- escher/include/escher/palette.h | 13 ++++++++++++ escher/src/palette.cpp | 18 +++++++++++++---- poincare/src/empty_layout.cpp | 2 +- 14 files changed, 51 insertions(+), 28 deletions(-) diff --git a/apps/apps_container_prompt_beta.cpp b/apps/apps_container_prompt_beta.cpp index 85be074d1..613acc99d 100644 --- a/apps/apps_container_prompt_beta.cpp +++ b/apps/apps_container_prompt_beta.cpp @@ -18,6 +18,6 @@ KDColor AppsContainer::k_promptColors[] = { KDColorWhite, KDColorBlack, KDColorBlack, - Palette::YellowDark}; + Palette::AccentText}; int AppsContainer::k_promptNumberOfMessages = 8; diff --git a/apps/apps_container_prompt_update.cpp b/apps/apps_container_prompt_update.cpp index 25fe11b64..e837b592f 100644 --- a/apps/apps_container_prompt_update.cpp +++ b/apps/apps_container_prompt_update.cpp @@ -14,6 +14,6 @@ KDColor AppsContainer::k_promptColors[] = { KDColorBlack, KDColorWhite, KDColorBlack, - Palette::YellowDark}; + Palette::AccentText}; int AppsContainer::k_promptNumberOfMessages = 6; diff --git a/apps/battery_view.cpp b/apps/battery_view.cpp index 4e056610d..9a72ab60b 100644 --- a/apps/battery_view.cpp +++ b/apps/battery_view.cpp @@ -63,31 +63,31 @@ 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), Palette::ToolbarText); + ctx->fillRect(KDRect(0, 0, k_elementWidth, k_batteryHeight), Palette::Battery); // Draw the middle part constexpr KDCoordinate batteryInsideX = k_elementWidth+k_separatorThickness; constexpr KDCoordinate batteryInsideWidth = k_batteryWidth-3*k_elementWidth-2*k_separatorThickness; if (m_isCharging) { // Charging: Yellow background with flash - ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::YellowLight); + ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::BatteryInCharge); KDRect frame((k_batteryWidth-k_flashWidth)/2, 0, k_flashWidth, k_flashHeight); - ctx->blendRectWithMask(frame, Palette::ToolbarText, (const uint8_t *)flashMask, s_flashWorkingBuffer); + ctx->blendRectWithMask(frame, Palette::Battery, (const uint8_t *)flashMask, s_flashWorkingBuffer); } else if (m_chargeState == Ion::Battery::Charge::LOW) { assert(!m_isPlugged); // Low: Quite empty battery - ctx->fillRect(KDRect(batteryInsideX, 0, 2*k_elementWidth, k_batteryHeight), Palette::LowBattery); - ctx->fillRect(KDRect(3*k_elementWidth+k_separatorThickness, 0, k_batteryWidth-5*k_elementWidth-2*k_separatorThickness, k_batteryHeight), Palette::YellowLight); + ctx->fillRect(KDRect(batteryInsideX, 0, 2*k_elementWidth, k_batteryHeight), Palette::BatteryLow); + ctx->fillRect(KDRect(3*k_elementWidth+k_separatorThickness, 0, k_batteryWidth-5*k_elementWidth-2*k_separatorThickness, k_batteryHeight), Palette::BatteryInCharge); } else if (m_chargeState == Ion::Battery::Charge::SOMEWHERE_INBETWEEN) { assert(!m_isPlugged); // Middle: Half full battery constexpr KDCoordinate middleChargeWidth = batteryInsideWidth/2; - ctx->fillRect(KDRect(batteryInsideX, 0, middleChargeWidth, k_batteryHeight), Palette::ToolbarText); - ctx->fillRect(KDRect(batteryInsideX+middleChargeWidth, 0, middleChargeWidth, k_batteryHeight), Palette::YellowLight); + ctx->fillRect(KDRect(batteryInsideX, 0, middleChargeWidth, k_batteryHeight), Palette::Battery); + ctx->fillRect(KDRect(batteryInsideX+middleChargeWidth, 0, middleChargeWidth, k_batteryHeight), Palette::BatteryInCharge); } else { assert(m_chargeState == Ion::Battery::Charge::FULL); // Full but not plugged: Full battery - ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::ToolbarText); + ctx->fillRect(KDRect(batteryInsideX, 0, batteryInsideWidth, k_batteryHeight), Palette::Battery); 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); @@ -96,8 +96,8 @@ void BatteryView::drawRect(KDContext * ctx, KDRect rect) const { } // Draw the right part - 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); + ctx->fillRect(KDRect(k_batteryWidth-2*k_elementWidth, 0, k_elementWidth, k_batteryHeight), Palette::Battery); + ctx->fillRect(KDRect(k_batteryWidth-k_elementWidth, (k_batteryHeight-k_capHeight)/2, k_elementWidth, k_capHeight), Palette::Battery); } KDSize BatteryView::minimalSizeForOptimalDisplay() const { diff --git a/apps/calculation/history_view_cell.cpp b/apps/calculation/history_view_cell.cpp index bda919a28..5369e3643 100644 --- a/apps/calculation/history_view_cell.cpp +++ b/apps/calculation/history_view_cell.cpp @@ -54,7 +54,7 @@ void HistoryViewCell::setHighlighted(bool highlight) { m_scrollableOutputView.evenOddCell()->setHighlighted(false); if (isHighlighted()) { if (m_dataSource->selectedSubviewType() == HistoryViewCellDataSource::SubviewType::Input) { - m_inputView.setExpressionBackgroundColor(Palette::Select); + m_inputView.setExpressionBackgroundColor(Palette::ListCellBackgroundSelected); } else { m_scrollableOutputView.evenOddCell()->setHighlighted(true); } diff --git a/apps/probability/distribution_curve_view.cpp b/apps/probability/distribution_curve_view.cpp index 295df6f77..0347d5967 100644 --- a/apps/probability/distribution_curve_view.cpp +++ b/apps/probability/distribution_curve_view.cpp @@ -29,9 +29,9 @@ void DistributionCurveView::drawRect(KDContext * ctx, KDRect rect) const { return; } if (m_distribution->isContinuous()) { - drawCartesianCurve(ctx, rect, -INFINITY, INFINITY, EvaluateXYAtAbscissa, m_distribution, nullptr, Palette::YellowDark, true, lowerBound, upperBound); + drawCartesianCurve(ctx, rect, -INFINITY, INFINITY, EvaluateXYAtAbscissa, m_distribution, nullptr, Palette::ProbabilityCurve, true, lowerBound, upperBound); } else { - drawHistogram(ctx, rect, EvaluateAtAbscissa, m_distribution, nullptr, 0, 1, false, Palette::GreyMiddle, Palette::YellowDark, lowerBound, upperBound+0.5f); + drawHistogram(ctx, rect, EvaluateAtAbscissa, m_distribution, nullptr, 0, 1, false, Palette::GreyMiddle, Palette::ProbabilityCurve, lowerBound, upperBound+0.5f); } } @@ -59,7 +59,7 @@ void DistributionCurveView::drawStandardNormal(KDContext * ctx, KDRect rect, flo // Draw a centered reduced normal curve NormalDistribution n; constCastedThis->setCurveViewRange(&n); - drawCartesianCurve(ctx, rect, -INFINITY, INFINITY, EvaluateXYAtAbscissa, &n, nullptr, Palette::YellowDark, true, pixelToFloat(Axis::Horizontal, colorLowerBoundPixel), pixelToFloat(Axis::Horizontal, colorUpperBoundPixel)); + drawCartesianCurve(ctx, rect, -INFINITY, INFINITY, EvaluateXYAtAbscissa, &n, nullptr, Palette::ProbabilityCurve, true, pixelToFloat(Axis::Horizontal, colorLowerBoundPixel), pixelToFloat(Axis::Horizontal, colorUpperBoundPixel)); // Put back the previous curve view range constCastedThis->setCurveViewRange(previousRange); diff --git a/apps/sequence/list/list_controller.cpp b/apps/sequence/list/list_controller.cpp index f38116d92..c9e0f7fc5 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, Palette::BackgroundHard, Palette::PurpleDark, Palette::PurpleDark), + m_typeStackController(nullptr, &m_typeParameterController, Palette::ToolboxHeaderText, Palette::ToolboxHeaderBackground, Palette::ToolboxHeaderBorder), m_sequenceToolbox() { for (int i = 0; i < k_maxNumberOfRows; i++) { diff --git a/apps/shared/scrollable_exact_approximate_expressions_view.cpp b/apps/shared/scrollable_exact_approximate_expressions_view.cpp index ee86a5b8d..0a6843418 100644 --- a/apps/shared/scrollable_exact_approximate_expressions_view.cpp +++ b/apps/shared/scrollable_exact_approximate_expressions_view.cpp @@ -29,9 +29,9 @@ void ScrollableExactApproximateExpressionsView::ContentCell::setHighlighted(bool m_approximateSign.setBackgroundColor(backgroundColor()); if (highlight) { if (m_selectedSubviewPosition == SubviewPosition::Left) { - m_leftExpressionView.setBackgroundColor(Palette::Select); + m_leftExpressionView.setBackgroundColor(Palette::ListCellBackgroundSelected); } else { - m_rightExpressionView.setBackgroundColor(Palette::Select); + m_rightExpressionView.setBackgroundColor(Palette::ListCellBackgroundSelected); } } } diff --git a/apps/solver/list_controller.cpp b/apps/solver/list_controller.cpp index 1ceecbafc..22064c015 100644 --- a/apps/solver/list_controller.cpp +++ b/apps/solver/list_controller.cpp @@ -16,7 +16,7 @@ ListController::ListController(Responder * parentResponder, EquationStore * equa ListController * list = (ListController *)context; list->resolveEquations(); return true; - }, this), KDFont::LargeFont, Palette::PurpleBright), + }, this), KDFont::LargeFont, Palette::ButtonText), m_modelsParameterController(this, equationStore, this), m_modelsStackController(nullptr, &m_modelsParameterController, Palette::BannerFirstVariantText, Palette::BannerFirstVariantBackground, Palette::BannerFirstVariantBorder) { diff --git a/apps/statistics/box_view.cpp b/apps/statistics/box_view.cpp index b111932c8..2c42700a0 100644 --- a/apps/statistics/box_view.cpp +++ b/apps/statistics/box_view.cpp @@ -86,7 +86,7 @@ void BoxView::drawRect(KDContext * ctx, KDRect rect) const { drawSegment(ctx, rect, Axis::Vertical, calculations[k], lowBound, upBound, Palette::GreyMiddle, k_quantileBarWidth); } if (isMainViewSelected()) { - drawSegment(ctx, rect, Axis::Vertical, calculations[(int)*m_selectedQuantile], lowBound, upBound, Palette::YellowDark, k_quantileBarWidth); + drawSegment(ctx, rect, Axis::Vertical, calculations[(int)*m_selectedQuantile], lowBound, upBound, Palette::StatisticsBox, k_quantileBarWidth); } } diff --git a/apps/statistics/histogram_view.h b/apps/statistics/histogram_view.h index 32117ffde..e3d79388c 100644 --- a/apps/statistics/histogram_view.h +++ b/apps/statistics/histogram_view.h @@ -13,7 +13,7 @@ class HistogramController; class HistogramView : public Shared::CurveView { public: - HistogramView(HistogramController * controller, Store * store, int series, Shared::BannerView * bannerView, KDColor selectedHistogramColor = Palette::Select, KDColor notSelectedHistogramColor = Palette::GreyMiddle, KDColor selectedBarColor = Palette::YellowDark); + HistogramView(HistogramController * controller, Store * store, int series, Shared::BannerView * bannerView, KDColor selectedHistogramColor = Palette::StatisticsSelect, KDColor notSelectedHistogramColor = Palette::GreyMiddle, KDColor selectedBarColor = Palette::StatisticsBox); int series() const { return m_series; } void reload() override; void reloadSelectedBar(); diff --git a/apps/usb/usb_connected_controller.cpp b/apps/usb/usb_connected_controller.cpp index 8df17e5a5..5dafb088c 100644 --- a/apps/usb/usb_connected_controller.cpp +++ b/apps/usb/usb_connected_controller.cpp @@ -17,7 +17,7 @@ static KDColor sUSBConnectedColors[] = { Palette::PrimaryText, Palette::PrimaryText, Palette::PrimaryText, - Palette::YellowDark, + Palette::AccentText, KDColorWhite, Palette::PrimaryText, Palette::PrimaryText, diff --git a/escher/include/escher/palette.h b/escher/include/escher/palette.h index dae09e767..0df9b315e 100644 --- a/escher/include/escher/palette.h +++ b/escher/include/escher/palette.h @@ -9,11 +9,15 @@ public: // Shared constexpr static KDColor PrimaryText = KDColor::RGB24(0x000000); constexpr static KDColor SecondaryText = KDColor::RGB24(0x6e6e6e); + constexpr static KDColor AccentText = KDColor::RGB24(0x00857f); 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); + constexpr static KDColor Battery = KDColor::RGB24(0xffffff); + constexpr static KDColor BatteryInCharge = KDColor::RGB24(0x179e1f); + constexpr static KDColor BatteryLow = KDColor::RGB24(0x992321); // Controls (switches, gauge, arrows...) constexpr static KDColor Control = KDColor::RGB24(0x00857f); @@ -23,6 +27,8 @@ public: // Calculation constexpr static KDColor CalculationBackgroundOdd = KDColor::RGB24(0xffffff); constexpr static KDColor CalculationBackgroundEven = KDColor::RGB24(0xfafafa); + constexpr static KDColor CalculationEmptyBox = KDColor::RGB24(0xc4c4c4); + constexpr static KDColor CalculationEmptyBoxNeeded = KDColor::RGB24(0x00857f); // Code constexpr static KDColor CodeBackground = KDColor::RGB24(0x000000); @@ -34,6 +40,13 @@ public: constexpr static KDColor CodeOperator = KDColor::RGB24(0xd73a49); constexpr static KDColor CodeString = KDColor::RGB24(0x032f62); + // Probability + constexpr static KDColor ProbabilityCurve = KDColor::RGB24(0x00857f); + + // Statistics + constexpr static KDColor StatisticsBox = KDColor::RGB24(0x00857f); + constexpr static KDColor StatisticsSelect = KDColor::RGB24(0xe0e0e0); + // SubMenus constexpr static KDColor SubMenuBackground = KDColor::RGB24(0xe0e0e0); constexpr static KDColor SubMenuBorder = KDColor::RGB24(0xfafafa); diff --git a/escher/src/palette.cpp b/escher/src/palette.cpp index 8e2f2e401..6e6f2b422 100644 --- a/escher/src/palette.cpp +++ b/escher/src/palette.cpp @@ -2,11 +2,15 @@ constexpr KDColor Palette::PrimaryText; constexpr KDColor Palette::SecondaryText; // =GREYDARK +constexpr KDColor Palette::AccentText; constexpr KDColor Palette::BackgroundHard; constexpr KDColor Palette::BackgroundApps; constexpr KDColor Palette::Toolbar; constexpr KDColor Palette::ToolbarText; constexpr KDColor Palette::ExpressionInputBackground; +constexpr KDColor Palette::Battery; +constexpr KDColor Palette::BatteryInCharge; +constexpr KDColor Palette::BatteryLow; constexpr KDColor Palette::Control; constexpr KDColor Palette::ControlEnabled; @@ -14,6 +18,8 @@ constexpr KDColor Palette::ControlDisabled; constexpr KDColor Palette::CalculationBackgroundOdd; constexpr KDColor Palette::CalculationBackgroundEven; +constexpr KDColor Palette::CalculationEmptyBox; +constexpr KDColor Palette::CalculationEmptyBoxNeeded; constexpr KDColor Palette::CodeBackground; constexpr KDColor Palette::CodeBackgroundSelected; @@ -24,6 +30,10 @@ constexpr KDColor Palette::CodeKeyword; constexpr KDColor Palette::CodeOperator; constexpr KDColor Palette::CodeString; +constexpr KDColor Palette::ProbabilityCurve; + +constexpr KDColor Palette::StatisticsBox; + constexpr KDColor Palette::SubMenuBackground; constexpr KDColor Palette::SubMenuBorder; constexpr KDColor Palette::SubMenuText; @@ -71,10 +81,10 @@ constexpr KDColor Palette::HomeCellBackgroundActive; constexpr KDColor Palette::HomeCellText; constexpr KDColor Palette::HomeCellTextActive; -constexpr KDColor Palette::YellowDark; -constexpr KDColor Palette::YellowLight; -constexpr KDColor Palette::PurpleBright; -constexpr KDColor Palette::PurpleDark; +constexpr KDColor Palette::YellowDark; // DONE +constexpr KDColor Palette::YellowLight; // DONE +constexpr KDColor Palette::PurpleBright; // DONE +constexpr KDColor Palette::PurpleDark; // DONE constexpr KDColor Palette::GreyWhite; constexpr KDColor Palette::GreyBright; constexpr KDColor Palette::GreyMiddle; diff --git a/poincare/src/empty_layout.cpp b/poincare/src/empty_layout.cpp index b89329cbc..6cc9e2471 100644 --- a/poincare/src/empty_layout.cpp +++ b/poincare/src/empty_layout.cpp @@ -88,7 +88,7 @@ bool EmptyLayoutNode::willAddSibling(LayoutCursor * cursor, LayoutNode * sibling void EmptyLayoutNode::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) { if (m_isVisible) { - KDColor fillColor = m_color == Color::Yellow ? Palette::YellowDark : Palette::GreyBright; + KDColor fillColor = m_color == Color::Yellow ? Palette::CalculationEmptyBoxNeeded : Palette::CalculationEmptyBox; ctx->fillRect(KDRect(p.x()+(m_margins ? k_marginWidth : 0), p.y()+(m_margins ? k_marginHeight : 0), width(), height()), fillColor); ctx->fillRect(KDRect(p.x()+(m_margins ? k_marginWidth : 0), p.y()+(m_margins ? k_marginHeight : 0), width(), height()), fillColor); }