mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
New dark theme & KDColorWhite -> Palette::BackgroundHard
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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); }
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<ScrollView::BarDecorator *>(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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <escher/palette.h>
|
||||
|
||||
constexpr KDColor Palette::Text;
|
||||
constexpr KDColor Palette::BackgroundHard;
|
||||
constexpr KDColor Palette::YellowDark;
|
||||
constexpr KDColor Palette::YellowLight;
|
||||
constexpr KDColor Palette::PurpleBright;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
2
themes
2
themes
Submodule themes updated: 3a30c39b9d...02bdefe785
Reference in New Issue
Block a user