mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 23:00:45 +01:00
[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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user