mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 00:00:44 +01:00
[apps/settings] Modify preferences_controller to add symbols
This commit is contained in:
@@ -130,6 +130,22 @@ Layout PreferencesController::layoutForPreferences(I18n::Message message) {
|
||||
return LayoutHelper::String(text, strlen(text), k_layoutFont);
|
||||
}
|
||||
|
||||
// Symbol controller
|
||||
case I18n::Message::SymbolMultiplicationCross: // × and · aren't single characters, so they cannot be constructed into codepoints..?
|
||||
{
|
||||
const char * text = "×";
|
||||
return LayoutHelper::String(text, strlen(text), k_layoutFont);
|
||||
}
|
||||
case I18n::Message::SymbolMultiplicationMiddleDot:
|
||||
{
|
||||
const char * text = "·";
|
||||
return LayoutHelper::String(text, strlen(text), k_layoutFont);
|
||||
}
|
||||
case I18n::Message::SymbolMultiplicationStar:
|
||||
return CodePointLayout::Builder('*', k_layoutFont);
|
||||
case I18n::Message::SymbolMultiplicationAutoSymbol:
|
||||
return CodePointLayout::Builder(' ', k_layoutFont);
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
return Layout();
|
||||
@@ -167,6 +183,8 @@ void PreferencesController::setPreferenceWithValueIndex(I18n::Message message, i
|
||||
preferences->setComplexFormat((Preferences::ComplexFormat)valueIndex);
|
||||
} else if (message == I18n::Message::LEDColor) {
|
||||
preferences->setColorOfLED((Preferences::LEDColor)valueIndex);
|
||||
} else if (message == I18n::Message::SymbolMultiplication) {
|
||||
preferences->setSymbolMultiplication((Preferences::SymbolMultiplication)valueIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,6 +205,9 @@ int PreferencesController::valueIndexForPreference(I18n::Message message) {
|
||||
if (message == I18n::Message::LEDColor) {
|
||||
return (int)preferences->colorOfLED();
|
||||
}
|
||||
if (message == I18n::Message::SymbolMultiplication) {
|
||||
return (int)preferences->symbolofMultiplication();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user