mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/code] Subtitles in the variable box
This commit is contained in:
@@ -6,3 +6,6 @@ AutoImportScript = "Automatischer Import in Konsole"
|
||||
DeleteScript = "Skript löschen"
|
||||
FunctionsAndVariables = "Funktionen und Variablen"
|
||||
AllowedCharactersaz09 = "Erlaubte Zeichen: a-z, 0-9, _"
|
||||
CurrentScript = "Current script"
|
||||
BuiltinFunctionsAndKeyWords = "Builtin functions and keywords"
|
||||
ImportedModulesAndScripts = "Imported modules and scripts"
|
||||
|
||||
@@ -6,3 +6,6 @@ AutoImportScript = "Auto import in shell"
|
||||
DeleteScript = "Delete script"
|
||||
FunctionsAndVariables = "Functions and variables"
|
||||
AllowedCharactersaz09 = "Allowed characters: a-z, 0-9, _"
|
||||
CurrentScript = "Current script"
|
||||
BuiltinFunctionsAndKeyWords = "Builtin functions and keywords"
|
||||
ImportedModulesAndScripts = "Imported modules and scripts"
|
||||
|
||||
@@ -6,3 +6,6 @@ AutoImportScript = "Importación auto en intérprete"
|
||||
DeleteScript = "Eliminar el archivo"
|
||||
FunctionsAndVariables = "Funciones y variables"
|
||||
AllowedCharactersaz09 = "Caracteres permitidos : a-z, 0-9, _"
|
||||
CurrentScript = "Current script"
|
||||
BuiltinFunctionsAndKeyWords = "Builtin functions and keywords"
|
||||
ImportedModulesAndScripts = "Imported modules and scripts"
|
||||
|
||||
@@ -6,3 +6,6 @@ AutoImportScript = "Importation auto dans la console"
|
||||
DeleteScript = "Supprimer le script"
|
||||
FunctionsAndVariables = "Fonctions et variables"
|
||||
AllowedCharactersaz09 = "Caractères autorisés : a-z, 0-9, _"
|
||||
CurrentScript = "Script en cours"
|
||||
BuiltinFunctionsAndKeyWords = "Fonctions natives et mots-clés"
|
||||
ImportedModulesAndScripts = "Modules et scripts importés"
|
||||
|
||||
@@ -6,3 +6,6 @@ AutoImportScript = "Importação auto no interpretador"
|
||||
DeleteScript = "Eliminar o script"
|
||||
FunctionsAndVariables = "Funções e variáveis"
|
||||
AllowedCharactersaz09 = "Caracteres permitidos : a-z, 0-9, _"
|
||||
CurrentScript = "Current script"
|
||||
BuiltinFunctionsAndKeyWords = "Builtin functions and keywords"
|
||||
ImportedModulesAndScripts = "Imported modules and scripts"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <apps/global_preferences.h>
|
||||
#include <poincare/integer.h>
|
||||
#include <escher/app.h>
|
||||
#include <escher/palette.h>
|
||||
|
||||
namespace Code {
|
||||
|
||||
@@ -56,7 +57,7 @@ void EditorView::layoutSubviews(bool force) {
|
||||
/* EditorView::GutterView */
|
||||
|
||||
void EditorView::GutterView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDColor textColor = KDColor::RGB24(0x919EA4);
|
||||
KDColor textColor = Palette::BlueishGrey;
|
||||
KDColor backgroundColor = KDColor::RGB24(0xE4E6E7);
|
||||
|
||||
ctx->fillRect(rect, backgroundColor);
|
||||
|
||||
@@ -56,6 +56,16 @@ VariableBoxController::VariableBoxController(ScriptStore * scriptStore) :
|
||||
for (int i = 0; i < k_maxNumberOfDisplayedRows; i++) {
|
||||
m_leafCells[i].setScriptStore(scriptStore);
|
||||
}
|
||||
I18n::Message subtitleMessages[k_scriptOriginsCount] = {
|
||||
I18n::Message::CurrentScript,
|
||||
I18n::Message::BuiltinFunctionsAndKeyWords,
|
||||
I18n::Message::ImportedModulesAndScripts
|
||||
};
|
||||
for (int i = 0; i < k_scriptOriginsCount; i++) {
|
||||
m_subtitleCells[i].setEven(true);
|
||||
m_subtitleCells[i].setAlignment(0.0f, 0.5f);
|
||||
m_subtitleCells[i].setMessage(subtitleMessages[i], Palette::BlueishGrey);
|
||||
}
|
||||
}
|
||||
|
||||
bool VariableBoxController::handleEvent(Ion::Events::Event event) {
|
||||
|
||||
@@ -37,6 +37,7 @@ private:
|
||||
constexpr static int k_maxNumberOfDisplayedRows = 6; // 240/40
|
||||
constexpr static int k_maxScriptNodesCount = 32; //TODO LEA
|
||||
constexpr static int k_totalBuiltinNodesCount = 98;
|
||||
constexpr static uint8_t k_scriptOriginsCount = 3;
|
||||
enum class NodeOrigin : uint8_t {
|
||||
CurrentScript,
|
||||
Builtins,
|
||||
@@ -98,6 +99,7 @@ private:
|
||||
ScriptNode m_builtinNodes[k_totalBuiltinNodesCount];
|
||||
ScriptNode m_importedNodes[k_maxScriptNodesCount];
|
||||
ScriptNodeCell m_leafCells[k_maxNumberOfDisplayedRows];
|
||||
EvenOddMessageTextCell m_subtitleCells[k_scriptOriginsCount];
|
||||
ScriptStore * m_scriptStore;
|
||||
// TODO LEA Put these in an array?
|
||||
int m_currentScriptNodesCount;
|
||||
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
constexpr static KDColor GreenLight = KDColor::RGB24(0x52db8f);
|
||||
constexpr static KDColor Brown = KDColor::RGB24(0x8d7350);
|
||||
constexpr static KDColor Purple = KDColor::RGB24(0x6e2d79);
|
||||
constexpr static KDColor BlueishGrey = KDColor::RGB24(0x919ea4);
|
||||
constexpr static KDColor DataColor[] = {Red, Blue, Green, YellowDark, Magenta, Turquoise, Pink, Orange};
|
||||
constexpr static KDColor DataColorLight[] = {RedLight, BlueLight, GreenLight, YellowLight};
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ constexpr KDColor Palette::Green;
|
||||
constexpr KDColor Palette::GreenLight;
|
||||
constexpr KDColor Palette::Brown;
|
||||
constexpr KDColor Palette::Purple;
|
||||
constexpr KDColor Palette::BlueishGrey;
|
||||
constexpr KDColor Palette::DataColor[];
|
||||
constexpr KDColor Palette::DataColorLight[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user