[Feature] Add root and log setting (#290)

* [setting + layout] add function setting

* [GitHub] GitHub Actions

* [GitHub/Fix] GitHub Actions

* Update config.mak

* Fix setting name

* Fix setting name

* Fix setting name

* Fix setting name

* Fix setting name

* Fix setting name

* Fix typo error

* Fix trad

Co-authored-by: Quentin Guidée <quentin.guidee@gmail.com>
This commit is contained in:
Evann DREUMONT
2020-06-13 00:10:33 +02:00
committed by GitHub
parent b7a5abe597
commit f0c46adebe
16 changed files with 182 additions and 6 deletions

View File

@@ -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::ResultDisplay) {
preferences->setResultDisplay((Preferences::ResultDisplay)valueIndex);
} else if (message == I18n::Message::FontSizes) {
@@ -274,6 +292,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::ResultDisplay) {
return (int)preferences->resultDisplay();
}