mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[Fix] Conflicts
This commit is contained in:
@@ -58,6 +58,10 @@ SymbolMultiplicationCross = "Kreuz "
|
||||
SymbolMultiplicationMiddleDot = "Mittelpunkt "
|
||||
SymbolMultiplicationStar = "Stern "
|
||||
SymbolMultiplicationAutoSymbol = "automatisch "
|
||||
SymbolFunction = "Ausdrucksformat "
|
||||
SymbolDefaultFunction = "Standardl "
|
||||
SymbolArgFunction = "Leer "
|
||||
SymbolArgDefaultFunction = "Argument "
|
||||
PythonFont = "Python Schriftart"
|
||||
Large = "Groß "
|
||||
Small = "Klein "
|
||||
|
||||
@@ -58,6 +58,10 @@ SymbolMultiplicationCross = "Cross "
|
||||
SymbolMultiplicationMiddleDot = "Dot "
|
||||
SymbolMultiplicationStar = "Star "
|
||||
SymbolMultiplicationAutoSymbol = "Auto "
|
||||
SymbolFunction = "Expression format "
|
||||
SymbolDefaultFunction = "Default "
|
||||
SymbolArgFunction = "Empty "
|
||||
SymbolArgDefaultFunction = "Argument "
|
||||
PythonFont = "Python Font"
|
||||
Large = "Large "
|
||||
Small = "Small "
|
||||
|
||||
@@ -58,6 +58,10 @@ SymbolMultiplicationCross = "Contrariar "
|
||||
SymbolMultiplicationMiddleDot = "Punto "
|
||||
SymbolMultiplicationStar = "Estrella "
|
||||
SymbolMultiplicationAutoSymbol = "Auto "
|
||||
SymbolFunction = "Formato expresión "
|
||||
SymbolDefaultFunction = "Defecto "
|
||||
SymbolArgFunction = "Vacío "
|
||||
SymbolArgDefaultFunction = "Argumento "
|
||||
PythonFont = "Fuente Python"
|
||||
Large = "Grande "
|
||||
Small = "Pequeña "
|
||||
|
||||
@@ -58,6 +58,10 @@ SymbolMultiplicationCross = "Croix "
|
||||
SymbolMultiplicationMiddleDot = "Point "
|
||||
SymbolMultiplicationStar = "Etoile "
|
||||
SymbolMultiplicationAutoSymbol = "Automatique "
|
||||
SymbolFunction = "Format expressions "
|
||||
SymbolDefaultFunction = "Défaut "
|
||||
SymbolArgFunction = "Vide "
|
||||
SymbolArgDefaultFunction = "Arguments "
|
||||
PythonFont = "Police Python"
|
||||
Large = "Grand "
|
||||
Small = "Petit "
|
||||
|
||||
@@ -58,6 +58,10 @@ SymbolMultiplicationCross = "Kereszt"
|
||||
SymbolMultiplicationMiddleDot = "Pont "
|
||||
SymbolMultiplicationStar = "Csillag "
|
||||
SymbolMultiplicationAutoSymbol = "Automata "
|
||||
SymbolFunction = "Kifejezési formátum "
|
||||
SymbolDefaultFunction = "alapértelmezett "
|
||||
SymbolArgFunction = "Üres "
|
||||
SymbolArgDefaultFunction = "Argumentummal "
|
||||
PythonFont = "Python Betütipus"
|
||||
Large = "Nagy "
|
||||
Small = "Kicsi "
|
||||
|
||||
@@ -58,6 +58,10 @@ SymbolMultiplicationCross = "crómio "
|
||||
SymbolMultiplicationMiddleDot = "ponto médio "
|
||||
SymbolMultiplicationStar = "estrela "
|
||||
SymbolMultiplicationAutoSymbol = "automático "
|
||||
SymbolFunction = "Formato expressão "
|
||||
SymbolDefaultFunction = "Padrão "
|
||||
SymbolArgFunction = "Vazio "
|
||||
SymbolArgDefaultFunction = "Argumento "
|
||||
PythonFont = "Fonte Python"
|
||||
Large = "Ampla "
|
||||
Small = "Pequeno "
|
||||
|
||||
@@ -14,7 +14,8 @@ constexpr SettingsMessageTree s_modelEditionModeChildren[2] = {SettingsMessageTr
|
||||
constexpr SettingsMessageTree s_modelFloatDisplayModeChildren[4] = {SettingsMessageTree(I18n::Message::Decimal), SettingsMessageTree(I18n::Message::Scientific), SettingsMessageTree(I18n::Message::Engineering), SettingsMessageTree(I18n::Message::SignificantFigures)};
|
||||
constexpr SettingsMessageTree s_modelComplexFormatChildren[3] = {SettingsMessageTree(I18n::Message::Real), SettingsMessageTree(I18n::Message::Cartesian), SettingsMessageTree(I18n::Message::Polar)};
|
||||
constexpr SettingsMessageTree s_symbolChildren[4] = {SettingsMessageTree(I18n::Message::SymbolMultiplicationCross),SettingsMessageTree(I18n::Message::SymbolMultiplicationMiddleDot),SettingsMessageTree(I18n::Message::SymbolMultiplicationStar),SettingsMessageTree(I18n::Message::SymbolMultiplicationAutoSymbol)};
|
||||
constexpr SettingsMessageTree s_modelMathOptionsChildren[5] = {SettingsMessageTree(I18n::Message::AngleUnit, s_modelAngleChildren), SettingsMessageTree(I18n::Message::DisplayMode, s_modelFloatDisplayModeChildren), SettingsMessageTree(I18n::Message::EditionMode, s_modelEditionModeChildren), SettingsMessageTree(I18n::Message::ComplexFormat, s_modelComplexFormatChildren), SettingsMessageTree(I18n::Message::SymbolMultiplication, s_symbolChildren)};
|
||||
constexpr SettingsMessageTree s_symbolFunctionChildren[3] = {SettingsMessageTree(I18n::Message::SymbolDefaultFunction), SettingsMessageTree(I18n::Message::SymbolArgDefaultFunction), SettingsMessageTree(I18n::Message::SymbolArgFunction)};
|
||||
constexpr SettingsMessageTree s_modelMathOptionsChildren[6] = {SettingsMessageTree(I18n::Message::AngleUnit, s_modelAngleChildren), SettingsMessageTree(I18n::Message::DisplayMode, s_modelFloatDisplayModeChildren), SettingsMessageTree(I18n::Message::EditionMode, s_modelEditionModeChildren), SettingsMessageTree(I18n::Message::ComplexFormat, s_modelComplexFormatChildren), SettingsMessageTree(I18n::Message::SymbolMultiplication, s_symbolChildren), SettingsMessageTree(I18n::Message::SymbolFunction, s_symbolFunctionChildren)};
|
||||
constexpr SettingsMessageTree s_modelFontChildren[2] = {SettingsMessageTree(I18n::Message::LargeFont), SettingsMessageTree(I18n::Message::SmallFont)};
|
||||
constexpr SettingsMessageTree s_accessibilityChildren[6] = {SettingsMessageTree(I18n::Message::AccessibilityInvertColors), SettingsMessageTree(I18n::Message::AccessibilityMagnify),SettingsMessageTree(I18n::Message::AccessibilityGamma),SettingsMessageTree(I18n::Message::AccessibilityGammaRed),SettingsMessageTree(I18n::Message::AccessibilityGammaGreen),SettingsMessageTree(I18n::Message::AccessibilityGammaBlue)};
|
||||
constexpr SettingsMessageTree s_contributorsChildren[17] = {SettingsMessageTree(I18n::Message::Developers), SettingsMessageTree(I18n::Message::QuentinGuidee), SettingsMessageTree(I18n::Message::DannySimmons), SettingsMessageTree(I18n::Message::JoachimLeFournis), SettingsMessageTree(I18n::Message::JeanBaptisteBoric), SettingsMessageTree(I18n::Message::MaximeFriess), SettingsMessageTree(I18n::Message::David), SettingsMessageTree(I18n::Message::DamienNicolet), SettingsMessageTree(I18n::Message::EvannDreumont), SettingsMessageTree(I18n::Message::SzaboLevente), SettingsMessageTree(I18n::Message::VenceslasDuet), SettingsMessageTree(I18n::Message::CharlotteThomas), SettingsMessageTree(I18n::Message::BetaTesters), SettingsMessageTree(I18n::Message::CyprienMejat), SettingsMessageTree(I18n::Message::TimeoArnouts), SettingsMessageTree(I18n::Message::LouisC), SettingsMessageTree(I18n::Message::LelahelHideux)};
|
||||
|
||||
@@ -18,7 +18,8 @@ extern const Shared::SettingsMessageTree s_modelEditionModeChildren[2];
|
||||
extern const Shared::SettingsMessageTree s_modelFloatDisplayModeChildren[4];
|
||||
extern const Shared::SettingsMessageTree s_modelComplexFormatChildren[3];
|
||||
extern const Shared::SettingsMessageTree s_symbolChildren[4];
|
||||
extern const Shared::SettingsMessageTree s_modelMathOptionsChildren[5];
|
||||
extern const Shared::SettingsMessageTree s_symbolFunctionChildren[3];
|
||||
extern const Shared::SettingsMessageTree s_modelMathOptionsChildren[6];
|
||||
extern const Shared::SettingsMessageTree s_modelFontChildren[2];
|
||||
extern const Shared::SettingsMessageTree s_accessibilityChildren[6];
|
||||
extern const Shared::SettingsMessageTree s_contributorsChildren[17];
|
||||
|
||||
@@ -66,6 +66,9 @@ void MathOptionsController::willDisplayCellForIndex(HighlightCell * cell, int in
|
||||
case I18n::Message::SymbolMultiplication:
|
||||
childIndex = (int)preferences->symbolofMultiplication();
|
||||
break;
|
||||
case I18n::Message::SymbolFunction:
|
||||
childIndex = (int)preferences->symbolofFunction();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
int reusableCellCount(int type) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCell = 6;
|
||||
constexpr static int k_totalNumberOfCell = 7;
|
||||
MessageTableCellWithChevronAndMessage m_cells[k_totalNumberOfCell];
|
||||
PreferencesController m_preferencesController;
|
||||
DisplayModeController m_displayModeController;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <poincare/code_point_layout.h>
|
||||
#include <poincare/fraction_layout.h>
|
||||
#include <poincare/vertical_offset_layout.h>
|
||||
#include <poincare/nth_root_layout.h>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace Poincare;
|
||||
@@ -181,7 +182,22 @@ Layout PreferencesController::layoutForPreferences(I18n::Message message) {
|
||||
return CodePointLayout::Builder('*', k_layoutFont);
|
||||
case I18n::Message::SymbolMultiplicationAutoSymbol:
|
||||
return CodePointLayout::Builder(' ', k_layoutFont);
|
||||
|
||||
|
||||
|
||||
// Symbol function
|
||||
case I18n::Message::SymbolDefaultFunction:
|
||||
{
|
||||
return NthRootLayout::Builder(CodePointLayout::Builder('x'));
|
||||
}
|
||||
case I18n::Message::SymbolArgDefaultFunction:
|
||||
{
|
||||
return NthRootLayout::Builder(CodePointLayout::Builder('x'), CodePointLayout::Builder('2'));
|
||||
}
|
||||
case I18n::Message::SymbolArgFunction:
|
||||
{
|
||||
return NthRootLayout::Builder(CodePointLayout::Builder('x'), CodePointLayout::Builder('y'));
|
||||
}
|
||||
|
||||
// Result display
|
||||
case I18n::Message::DefaultResult:
|
||||
{
|
||||
@@ -244,6 +260,8 @@ void PreferencesController::setPreferenceWithValueIndex(I18n::Message message, i
|
||||
GlobalPreferences::sharedGlobalPreferences()->setTempExamMode((GlobalPreferences::ExamMode)((uint8_t)valueIndex + 1));
|
||||
} else if (message == I18n::Message::SymbolMultiplication) {
|
||||
preferences->setSymbolMultiplication((Preferences::SymbolMultiplication)valueIndex);
|
||||
} else if (message == I18n::Message::SymbolFunction) {
|
||||
preferences->setSymbolofFunction((Preferences::SymbolFunction)valueIndex);
|
||||
} else if (message == I18n::Message::FontSizes) {
|
||||
GlobalPreferences::sharedGlobalPreferences()->setFont(valueIndex == 0 ? KDFont::LargeFont : KDFont::SmallFont);
|
||||
}
|
||||
@@ -271,6 +289,9 @@ int PreferencesController::valueIndexForPreference(I18n::Message message) const
|
||||
if (message == I18n::Message::SymbolMultiplication) {
|
||||
return (int)preferences->symbolofMultiplication();
|
||||
}
|
||||
if (message == I18n::Message::SymbolFunction) {
|
||||
return (int)preferences->symbolofFunction();
|
||||
}
|
||||
if (message == I18n::Message::FontSizes) {
|
||||
return GlobalPreferences::sharedGlobalPreferences()->font() == KDFont::LargeFont ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,9 @@ bool LayoutField::handleEventWithText(const char * text, bool indentation, bool
|
||||
} else if (strcmp(text, Ion::Events::Power.text()) == 0) {
|
||||
cursor->addEmptyPowerLayout();
|
||||
} else if (strcmp(text, Ion::Events::Sqrt.text()) == 0) {
|
||||
cursor->addEmptySquareRootLayout();
|
||||
m_contentView.cursor()->addRoot();
|
||||
} else if (strcmp(text, Ion::Events::Log.text()) == 0) {
|
||||
m_contentView.cursor()->addLog();
|
||||
} else if (strcmp(text, Ion::Events::Square.text()) == 0) {
|
||||
cursor->addEmptySquarePowerLayout();
|
||||
} else if (strcmp(text, Ion::Events::EE.text()) == 0) {
|
||||
|
||||
@@ -109,7 +109,14 @@ public:
|
||||
void addEmptyExponentialLayout();
|
||||
void addEmptyMatrixLayout();
|
||||
void addEmptyPowerLayout();
|
||||
void addRoot();
|
||||
void addLog();
|
||||
void addEmptyLog();
|
||||
void addEmpty10Log();
|
||||
void addEmptyArgLog();
|
||||
void addEmptySquareRootLayout();
|
||||
void addEmptyRootLayout();
|
||||
void addEmptyArgSquareRootLayout();
|
||||
void addEmptySquarePowerLayout();
|
||||
void addEmptyTenPowerLayout();
|
||||
void addFractionLayoutAndCollapseSiblings();
|
||||
|
||||
@@ -52,6 +52,11 @@ public:
|
||||
Star = 2,
|
||||
Auto = 3
|
||||
};
|
||||
enum class SymbolFunction : uint8_t {
|
||||
Default = 0,
|
||||
ArgDefault = 1,
|
||||
Arg = 2
|
||||
};
|
||||
enum class PythonFont : uint8_t {
|
||||
Large = 0,
|
||||
Small = 1
|
||||
@@ -72,6 +77,8 @@ public:
|
||||
void setColorOfLED(LEDColor color) { m_colorOfLED = color; }
|
||||
SymbolMultiplication symbolofMultiplication() const { return m_symbolMultiplication; }
|
||||
void setSymbolMultiplication(SymbolMultiplication symbolofMultiplication) { m_symbolMultiplication = symbolofMultiplication; }
|
||||
SymbolFunction symbolofFunction() const { return m_symbolFunction; }
|
||||
void setSymbolofFunction(SymbolFunction symbolofFunction) { m_symbolFunction = symbolofFunction; }
|
||||
PythonFont pythonFont() const { return m_pythonFont; }
|
||||
void setPythonFont(PythonFont pythonFont) { m_pythonFont = pythonFont; }
|
||||
const KDFont * KDPythonFont() const { return (m_pythonFont == PythonFont::Small) ? KDFont::SmallFont : KDFont::LargeFont; }
|
||||
@@ -83,6 +90,7 @@ private:
|
||||
uint8_t m_numberOfSignificantDigits;
|
||||
LEDColor m_colorOfLED;
|
||||
SymbolMultiplication m_symbolMultiplication;
|
||||
SymbolFunction m_symbolFunction;
|
||||
PythonFont m_pythonFont;
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <poincare/empty_layout.h>
|
||||
#include <poincare/fraction_layout.h>
|
||||
#include <poincare/horizontal_layout.h>
|
||||
#include <poincare/layout_helper.h>
|
||||
#include <poincare/layout.h>
|
||||
#include <poincare/left_parenthesis_layout.h>
|
||||
#include <poincare/matrix_layout.h>
|
||||
@@ -108,6 +109,90 @@ void LayoutCursor::addEmptyMatrixLayout() {
|
||||
m_position = Position::Right;
|
||||
}
|
||||
|
||||
void LayoutCursor::addLog() {
|
||||
Preferences * preferences = Preferences::sharedPreferences();
|
||||
switch((int)preferences->symbolofFunction()){
|
||||
case 1:
|
||||
addEmpty10Log();
|
||||
break;
|
||||
case 2:
|
||||
addEmptyArgLog();
|
||||
break;
|
||||
default:
|
||||
addEmptyLog();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptyLog() {
|
||||
HorizontalLayout child1 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
HorizontalLayout child2 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
Layout logLayout = LayoutHelper::String("log", 3);
|
||||
HorizontalLayout resultLayout = static_cast<HorizontalLayout &>(logLayout);
|
||||
//VerticalOffsetLayout offsetLayout = VerticalOffsetLayout::Builder(child2, VerticalOffsetLayoutNode::Position::Subscript);
|
||||
//resultLayout.addChildAtIndex(offsetLayout, resultLayout.numberOfChildren(), resultLayout.numberOfChildren(), nullptr);
|
||||
resultLayout.addChildAtIndex(HorizontalLayout::Builder(
|
||||
LeftParenthesisLayout::Builder(),
|
||||
child1,
|
||||
RightParenthesisLayout::Builder()
|
||||
|
||||
), resultLayout.numberOfChildren(), resultLayout.numberOfChildren(), nullptr);
|
||||
|
||||
m_layout.addSibling(this, resultLayout, true);
|
||||
LayoutCursor::moveLeft(nullptr, false);
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmpty10Log() {
|
||||
HorizontalLayout child1 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
HorizontalLayout child2 = HorizontalLayout::Builder(CodePointLayout::Builder('1'),CodePointLayout::Builder('0'));
|
||||
Layout logLayout = LayoutHelper::String("log", 3);
|
||||
HorizontalLayout resultLayout = static_cast<HorizontalLayout &>(logLayout);
|
||||
VerticalOffsetLayout offsetLayout = VerticalOffsetLayout::Builder(child2, VerticalOffsetLayoutNode::Position::Subscript);
|
||||
resultLayout.addChildAtIndex(offsetLayout, resultLayout.numberOfChildren(), resultLayout.numberOfChildren(), nullptr);
|
||||
resultLayout.addChildAtIndex(HorizontalLayout::Builder(
|
||||
LeftParenthesisLayout::Builder(),
|
||||
child1,
|
||||
RightParenthesisLayout::Builder()
|
||||
|
||||
), resultLayout.numberOfChildren(), resultLayout.numberOfChildren(), nullptr);
|
||||
|
||||
m_layout.addSibling(this, resultLayout, true);
|
||||
LayoutCursor::moveLeft(nullptr, false);
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptyArgLog() {
|
||||
HorizontalLayout child1 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
HorizontalLayout child2 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
Layout logLayout = LayoutHelper::String("log", 3);
|
||||
HorizontalLayout resultLayout = static_cast<HorizontalLayout &>(logLayout);
|
||||
VerticalOffsetLayout offsetLayout = VerticalOffsetLayout::Builder(child2, VerticalOffsetLayoutNode::Position::Subscript);
|
||||
resultLayout.addChildAtIndex(offsetLayout, resultLayout.numberOfChildren(), resultLayout.numberOfChildren(), nullptr);
|
||||
resultLayout.addChildAtIndex(HorizontalLayout::Builder(
|
||||
LeftParenthesisLayout::Builder(),
|
||||
child1,
|
||||
RightParenthesisLayout::Builder()
|
||||
|
||||
), resultLayout.numberOfChildren(), resultLayout.numberOfChildren(), nullptr);
|
||||
|
||||
m_layout.addSibling(this, resultLayout, true);
|
||||
LayoutCursor::moveLeft(nullptr, false);
|
||||
}
|
||||
|
||||
void LayoutCursor::addRoot() {
|
||||
Preferences * preferences = Preferences::sharedPreferences();
|
||||
switch((int)preferences->symbolofFunction()){
|
||||
case 1:
|
||||
addEmptyArgSquareRootLayout();
|
||||
break;
|
||||
case 2:
|
||||
addEmptyRootLayout();
|
||||
break;
|
||||
default:
|
||||
addEmptySquareRootLayout();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptySquareRootLayout() {
|
||||
// TODO: add a horizontal layout only if several children
|
||||
HorizontalLayout child1 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
@@ -118,6 +203,28 @@ void LayoutCursor::addEmptySquareRootLayout() {
|
||||
((Layout *)&newChild)->collapseSiblings(this);
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptyRootLayout() {
|
||||
// TODO: add a horizontal layout only if several children
|
||||
HorizontalLayout child1 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
HorizontalLayout child2 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
NthRootLayout newChild = NthRootLayout::Builder(child1, child2);
|
||||
m_layout.addSibling(this, newChild, false);
|
||||
m_layout = newChild.childAtIndex(0);
|
||||
m_position = Position::Right;
|
||||
((Layout *)&newChild)->collapseSiblings(this);
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptyArgSquareRootLayout() {
|
||||
// TODO: add a horizontal layout only if several children
|
||||
HorizontalLayout child1 = HorizontalLayout::Builder(EmptyLayout::Builder());
|
||||
HorizontalLayout child2 = HorizontalLayout::Builder(CodePointLayout::Builder('2'));
|
||||
NthRootLayout newChild = NthRootLayout::Builder(child1, child2);
|
||||
m_layout.addSibling(this, newChild, false);
|
||||
m_layout = newChild.childAtIndex(0);
|
||||
m_position = Position::Right;
|
||||
((Layout *)&newChild)->collapseSiblings(this);
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptyPowerLayout() {
|
||||
VerticalOffsetLayout offsetLayout = VerticalOffsetLayout::Builder(EmptyLayout::Builder(), VerticalOffsetLayoutNode::Position::Superscript);
|
||||
privateAddEmptyPowerLayout(offsetLayout);
|
||||
|
||||
@@ -15,6 +15,7 @@ Preferences::Preferences() :
|
||||
m_numberOfSignificantDigits(PrintFloat::k_numberOfPrintedSignificantDigits),
|
||||
m_colorOfLED(Preferences::LEDColor::Red),
|
||||
m_symbolMultiplication(Preferences::SymbolMultiplication::Auto),
|
||||
m_symbolFunction(Preferences::SymbolFunction::Default),
|
||||
m_pythonFont(Preferences::PythonFont::Large)
|
||||
{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user