mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-22 13:01:05 +03:00
ecode: add centralized settings panel and simplify settings menus
- add searchable user and project settings panels - organize settings into navigable categories and subsections - apply supported configuration changes in real time - add direct document and terminal settings accessors - retain only contextual actions in the legacy settings menus - replace legacy configuration dialogs with inline controls - improve modal behavior, keyboard navigation, and persistence - add validation for editable settings - update and remove obsolete i18n strings
This commit is contained in:
@@ -47,6 +47,7 @@ Diese Operation kann nicht rückgängig gemacht werden!</string>
|
||||
<string name="author">Autor</string>
|
||||
<string name="auto_close_brackets_and_tags">Klammern & Tags automatisch vervollständigen</string>
|
||||
<string name="auto_close_xml_tags">XML-Tags automatisch vervollständigen</string>
|
||||
<string name="auto_close_brackets_and_tags">Klammern & Tags automatisch vervollständigen</string>
|
||||
<string name="auto_detect_indent_type_and_width">Einzugsart- & weite automatisch erkennen</string>
|
||||
<string name="autoreload_on_disk_change">Auto-Auffrischen bei Dateiänderung im Festspeicher</string>
|
||||
<string name="back_quotes">Backticks ``</string>
|
||||
@@ -278,12 +279,9 @@ Soll es jetzt heruntergeladen werden?</string>
|
||||
<string name="discretionary_ligatures">Optionale Ligaturen (dlig)</string>
|
||||
<string name="discretionary_ligatures_desc">Optionale dekorative oder stilistische Ligaturen der Schriftart.</string>
|
||||
<string name="editor_font_size">Editor-Schriftgröße</string>
|
||||
<string name="editor_font_features">Editor-Schriftfunktionen</string>
|
||||
<string name="editor_go_back">Editor: Schritt zurück</string>
|
||||
<string name="editor_go_forward">Editor: Schritt nach vorn</string>
|
||||
<string name="editor_set_cursor_blinking_time">Editor: Blinkdauer der Eingabemarke festlegen</string>
|
||||
<string name="editor_set_indent_tab_character">Editor: Tab-Einzugszeichen festlegen</string>
|
||||
<string name="editor_set_line_breaking_column">Editor: Umbruchspalte setzen</string>
|
||||
<string name="editor_set_line_spacing">Editor: Zeilenabstand festlegen</string>
|
||||
<string name="empty_file_name">Der Dateiname darf nicht leer sein.</string>
|
||||
<string name="enable_autoreload">Auto-Auffrischen aktivieren</string>
|
||||
<string name="enable_color_picker">Farbwähler aktivieren</string>
|
||||
@@ -446,8 +444,6 @@ Für sichtbare Änderung ecode neu starten.</string>
|
||||
<string name="inspect_widgets">Widgets einsehen</string>
|
||||
<string name="issues">probleme</string>
|
||||
<string name="issues_capitalized">Probleme</string>
|
||||
<string name="it_must_be_a_single_character">Es muss ein einzelnes Zeichen sein</string>
|
||||
<string name="jump_lines_down">Zeilen abwärts springen</string>
|
||||
<string name="jump_lines_up">Zeilen aufwärts springen</string>
|
||||
<string name="keep_indentation">Einrückung beibehalten</string>
|
||||
<string name="key_bindings">Tastenzuweisungen</string>
|
||||
@@ -550,8 +546,6 @@ Für sichtbare Änderung ecode neu starten.</string>
|
||||
<string name="new_terminal_name">Neuer Konsolenname:</string>
|
||||
<string name="new_ui_language">Neue Sprache zugewiesen.
|
||||
Für vollständige Änderung bitte die Anwendung neu starten.</string>
|
||||
<string name="new_ui_scale_factor">Neue Oberflächenskalierung festgelegt.
|
||||
Bitte die Anwendung neu starten.</string>
|
||||
<string name="new_value">Neuer Wert</string>
|
||||
<string name="new_window">Neues Fenster</string>
|
||||
<string name="next">Nächstes</string>
|
||||
@@ -726,29 +720,9 @@ Bitte das Programmverzeichnis auf Schreibrechte überprüfen.</string>
|
||||
<string name="session_snapshot">Sitzungs-Snapshot & Regelmäßige Sicherung</string>
|
||||
<string name="session_snapshot_desc">Wenn Sitzungs-Snapshots aktiv sind, wird der Editor Änderungen im
|
||||
Dokumenten-Buffer beibehalten, auch, wenn sie vor Beendigung nicht gespeichert wurden.</string>
|
||||
<string name="set_cursor_blinking_time">Blinkdauer der Eingabemarke festlegen:
|
||||
Auf 0 setzen zum Deaktivieren.
|
||||
</string>
|
||||
<string name="set_editor_font_size">Editor-Schriftgröße festlegen:</string>
|
||||
<string name="set_fold_refresh_frequency">Blockfaltungsaktualisierungsfrequenz festlegen:
|
||||
Dies sollte größer als eine Sekunde sein.
|
||||
Faltungen werden nur bei Dokumentmodifikation aktualisiert.
|
||||
</string>
|
||||
<string name="set_frame_rate_limit">Bildwiederholrate begrenzen:
|
||||
Auf 0 setzen zum Deaktivieren.
|
||||
</string>
|
||||
<string name="set_indent_tab_character">Legt das Zeichen für den Tab-Einzugsmarker fest.</string>
|
||||
<string name="set_line_breaking_column">Umbruchspalte festlegen:
|
||||
Auf 0 setzen zum Deaktivieren.
|
||||
</string>
|
||||
<string name="set_line_spacing">Zeilenabstand festlegen:
|
||||
Auf 0 setzen zum Deaktivieren.
|
||||
</string>
|
||||
<string name="set_side_panel_font_size">Seitenpaneel-Schriftgöße festlegen:</string>
|
||||
<string name="set_terminal_font_size">Konsolenschriftgöße festlegen:</string>
|
||||
<string name="set_ui_font_size">Größe der Oberflächenschriftart festlegen:</string>
|
||||
<string name="set_ui_scale_factor">Oberflächenskalierung festlegen (Pixeldichte):
|
||||
Minimalwert ist 1, Maximalwert 6. Anwendungsneustart benötigt.</string>
|
||||
<string name="settings">Einstellungen</string>
|
||||
<string name="shell">Shell</string>
|
||||
<string name="shell_configuration">Shell-Konfiguration</string>
|
||||
@@ -869,6 +843,7 @@ in der Baumansicht und in Öffen-/Schließdialogen aktivieren.</string>
|
||||
<string name="type_to_locate">Zu findender Typ</string>
|
||||
<string name="ui_font_and_size_ellipsis">Schriftart und -größe der Oberfläche...</string>
|
||||
<string name="ui_font_size">Schriftgröße der Oberfläche</string>
|
||||
<string name="ui_font_features">UI-Schriftfunktionen</string>
|
||||
<string name="ui_language">Sprache der Oberfläche</string>
|
||||
<string name="ui_multisamples_level">Multisample-Antialiasing-Stufe</string>
|
||||
<string name="ui_panel_font_size">Schriftgröße im Paneel der Oberfläche</string>
|
||||
@@ -951,13 +926,7 @@ Für sichtbare Änderung ecode neu starten.</string>
|
||||
<string name="screenshot_filename_pattern">Dateinamensmuster</string>
|
||||
<string name="screenshot_save_format">Speicherformat</string>
|
||||
<string name="set_screenshot_filename_pattern">Dateinamensmuster für Bildschirmfotos festlegen</string>
|
||||
<string name="set_screenshot_filename_pattern_message">Legen Sie das Dateinamensmuster für Bildschirmfotos fest:
|
||||
Verwendet strftime-Formatbezeichner. Die Dateierweiterung richtet sich nach dem ausgewählten Bildschirmfotoformat.</string>
|
||||
<string name="set_screenshot_save_format">Speicherformat für Bildschirmfotos festlegen</string>
|
||||
<string name="set_screenshot_save_format_message">Wählen Sie das Speicherformat für Bildschirmfotos:</string>
|
||||
<string name="invalid_screenshot_filename_pattern">Das Dateinamensmuster für Bildschirmfotos ist ungültig.</string>
|
||||
<string name="invalid_screenshot_save_format">Ungültiges Speicherformat für Bildschirmfotos.</string>
|
||||
<string name="couldnt_create_screenshot_directory">Das Verzeichnis für Bildschirmfotos konnte nicht erstellt werden.</string>
|
||||
<string name="couldnt_find_available_screenshot_filename">Es konnte kein verfügbarer Dateiname für das Bildschirmfoto gefunden werden.</string>
|
||||
<string name="couldnt_save_screenshot">Das Bildschirmfoto konnte nicht gespeichert werden.</string>
|
||||
<string name="screenshot_saved">Bildschirmfoto gespeichert:</string>
|
||||
@@ -972,6 +941,8 @@ Verwendet strftime-Formatbezeichner. Die Dateierweiterung richtet sich nach dem
|
||||
<string name="set_tab_out_characters_message">Legen Sie die Zeichen fest, über die der Cursor beim Drücken von Tab springen kann.</string>
|
||||
<string name="open_settings_ellipsis">Einstellungen öffnen...</string>
|
||||
<string name="open_project_settings_ellipsis">Projekteinstellungen öffnen...</string>
|
||||
<string name="open_document_settings">Dokumenteinstellungen öffnen</string>
|
||||
<string name="open_terminal_settings">Terminaleinstellungen öffnen</string>
|
||||
<string name="project_settings">Projekteinstellungen</string>
|
||||
<string name="search_settings">Einstellungen durchsuchen...</string>
|
||||
<string name="show_line_numbers_desc">Zeilennummern neben dem Editor anzeigen.</string>
|
||||
|
||||
@@ -31,6 +31,7 @@ This operation cannot be reverted!</string>
|
||||
<string name="author">Author</string>
|
||||
<string name="auto_close_brackets_and_tags">Auto-Close Brackets & Tags</string>
|
||||
<string name="auto_close_xml_tags">Auto Close XML Tags</string>
|
||||
<string name="auto_close_brackets_and_tags">Auto-Close Brackets & Tags</string>
|
||||
<string name="auto_detect_indent_type_and_width">Auto Detect Indent Type & Width</string>
|
||||
<string name="autoreload_on_disk_change">Auto-Reload on Disk Change</string>
|
||||
<string name="back_quotes">Back Quotes ``</string>
|
||||
@@ -262,12 +263,9 @@ Do you want to download it now?</string>
|
||||
<string name="discretionary_ligatures">Discretionary Ligatures (dlig)</string>
|
||||
<string name="discretionary_ligatures_desc">Optional decorative or stylistic ligatures provided by the font.</string>
|
||||
<string name="editor_font_size">Editor Font Size</string>
|
||||
<string name="editor_font_features">Editor Font Features</string>
|
||||
<string name="editor_go_back">Editor Go Back</string>
|
||||
<string name="editor_go_forward">Editor Go Forward</string>
|
||||
<string name="editor_set_cursor_blinking_time">Editor Set Cursor Blinking Time</string>
|
||||
<string name="editor_set_indent_tab_character">Editor Set Indent Tab Character</string>
|
||||
<string name="editor_set_line_breaking_column">Editor Set Line Breaking Column</string>
|
||||
<string name="editor_set_line_spacing">Editor Set Line Spacing</string>
|
||||
<string name="empty_file_name">You must set a name to the file.</string>
|
||||
<string name="enable_autoreload">Enable Auto-Reload</string>
|
||||
<string name="enable_color_picker">Enable Color Picker</string>
|
||||
@@ -430,8 +428,6 @@ Restart ecode to see the changes.</string>
|
||||
<string name="inspect_widgets">Inspect Widgets</string>
|
||||
<string name="issues">issues</string>
|
||||
<string name="issues_capitalized">Issues</string>
|
||||
<string name="it_must_be_a_single_character">It must be a single character</string>
|
||||
<string name="jump_lines_down">Jump Lines Down</string>
|
||||
<string name="jump_lines_up">Jump Lines Up</string>
|
||||
<string name="keep_indentation">Keep Indentation</string>
|
||||
<string name="key_bindings">Key Bindings</string>
|
||||
@@ -534,8 +530,6 @@ Restart ecode to see the changes.</string>
|
||||
<string name="new_terminal_name">New terminal name:</string>
|
||||
<string name="new_ui_language">New language assigned.
|
||||
Please restart the application to see the complete changes.</string>
|
||||
<string name="new_ui_scale_factor">New UI scale factor assigned.
|
||||
Please restart the application.</string>
|
||||
<string name="new_value">New Value</string>
|
||||
<string name="new_window">New Window</string>
|
||||
<string name="next">Next</string>
|
||||
@@ -711,28 +705,9 @@ Please check that the application directory has write permissions.</string>
|
||||
<string name="session_snapshot_desc">When session snapshot is enabled the editor will keep
|
||||
the document buffer changes between sessions, even if they are not saved
|
||||
before exiting the program.</string>
|
||||
<string name="set_cursor_blinking_time">Set Cursor Blinking Time:
|
||||
Set 0 to disable it.
|
||||
</string>
|
||||
<string name="set_editor_font_size">Set the editor font size:</string>
|
||||
<string name="set_fold_refresh_frequency">Set code folds refresh frequency:
|
||||
It should be bigger than 1 second.
|
||||
Folds are only refreshed after any document modification.</string>
|
||||
<string name="set_frame_rate_limit">Set Frame Rate Limit:
|
||||
Set 0 to disable it.
|
||||
</string>
|
||||
<string name="set_indent_tab_character">Set the tab indentation guide character displayed.</string>
|
||||
<string name="set_line_breaking_column">Set Line Breaking Column:
|
||||
Set 0 to disable it.
|
||||
</string>
|
||||
<string name="set_line_spacing">Set Line Spacing:
|
||||
Set 0 to disable it.
|
||||
</string>
|
||||
<string name="set_side_panel_font_size">Set side panel font size:</string>
|
||||
<string name="set_terminal_font_size">Set the terminal font size:</string>
|
||||
<string name="set_ui_font_size">Set the UI font size:</string>
|
||||
<string name="set_ui_scale_factor">Set the UI scale factor (pixel density):
|
||||
Minimum value is 1, and maximum 6. Requires restart.</string>
|
||||
<string name="settings">Settings</string>
|
||||
<string name="shell">Shell</string>
|
||||
<string name="shell_configuration">Shell Configuration</string>
|
||||
@@ -853,6 +828,7 @@ the directory tree and in file dialogs to open a folder or file.</string>
|
||||
<string name="type_to_locate">Type to Locate</string>
|
||||
<string name="ui_font_and_size_ellipsis">UI Font & Size...</string>
|
||||
<string name="ui_font_size">Ui Font Size</string>
|
||||
<string name="ui_font_features">UI Font Features</string>
|
||||
<string name="ui_language">UI Language</string>
|
||||
<string name="ui_multisamples_level">Multisample Anti-Aliasing Level</string>
|
||||
<string name="ui_panel_font_size">Ui Panel Font Size</string>
|
||||
@@ -935,13 +911,7 @@ Restart ecode to see the changes.</string>
|
||||
<string name="screenshot_filename_pattern">Filename Pattern</string>
|
||||
<string name="screenshot_save_format">Save Format</string>
|
||||
<string name="set_screenshot_filename_pattern">Set Screenshot Filename Pattern</string>
|
||||
<string name="set_screenshot_filename_pattern_message">Set the screenshot filename pattern:
|
||||
Uses strftime format specifiers. The file extension follows the selected screenshot format.</string>
|
||||
<string name="set_screenshot_save_format">Set Screenshot Save Format</string>
|
||||
<string name="set_screenshot_save_format_message">Select the screenshot save format:</string>
|
||||
<string name="invalid_screenshot_filename_pattern">The screenshot filename pattern is invalid.</string>
|
||||
<string name="invalid_screenshot_save_format">Invalid screenshot save format.</string>
|
||||
<string name="couldnt_create_screenshot_directory">Couldn't create the screenshot directory.</string>
|
||||
<string name="couldnt_find_available_screenshot_filename">Couldn't find an available screenshot filename.</string>
|
||||
<string name="couldnt_save_screenshot">Couldn't save the screenshot.</string>
|
||||
<string name="screenshot_saved">Screenshot saved:</string>
|
||||
@@ -956,6 +926,8 @@ Uses strftime format specifiers. The file extension follows the selected screens
|
||||
<string name="set_tab_out_characters_message">Set the characters the cursor can move past when pressing Tab.</string>
|
||||
<string name="open_settings_ellipsis">Open Settings...</string>
|
||||
<string name="open_project_settings_ellipsis">Open Project Settings...</string>
|
||||
<string name="open_document_settings">Open Document Settings</string>
|
||||
<string name="open_terminal_settings">Open Terminal Settings</string>
|
||||
<string name="project_settings">Project Settings</string>
|
||||
<string name="search_settings">Search settings...</string>
|
||||
<string name="show_line_numbers_desc">Display line numbers beside the editor.</string>
|
||||
|
||||
@@ -32,6 +32,7 @@ Cette opération est irréversible !</string>
|
||||
<string name="author">Auteur</string>
|
||||
<string name="auto_close_brackets_and_tags">Fermeture automatique des crochets et des balises</string>
|
||||
<string name="auto_close_xml_tags">Fermeture automatique des balises XML</string>
|
||||
<string name="auto_close_brackets_and_tags">Fermeture automatique des crochets et des balises</string>
|
||||
<string name="auto_detect_indent_type_and_width">Détection automatique du type et de la taille de l'indentation</string>
|
||||
<string name="autoreload_on_disk_change">Rechargement automatique en cas de modification du disque</string>
|
||||
<string name="back_quotes">Guillemets inversés ``</string>
|
||||
@@ -263,12 +264,9 @@ Voulez-vous le télécharger maintenant ?</string>
|
||||
<string name="discretionary_ligatures">Ligatures discrétionnaires (dlig)</string>
|
||||
<string name="discretionary_ligatures_desc">Ligatures décoratives ou stylistiques facultatives fournies par la police.</string>
|
||||
<string name="editor_font_size">Taille de la police de l'éditeur</string>
|
||||
<string name="editor_font_features">Fonctionnalités de la police de l'éditeur</string>
|
||||
<string name="editor_go_back">Éditeur : retour en arrière</string>
|
||||
<string name="editor_go_forward">Éditeur : avancer</string>
|
||||
<string name="editor_set_cursor_blinking_time">Éditeur : définir le temps de clignotement du curseur</string>
|
||||
<string name="editor_set_indent_tab_character">Éditeur : définir le caractère de tabulation d'indentation</string>
|
||||
<string name="editor_set_line_breaking_column">Éditeur : définir la colonne de saut de ligne</string>
|
||||
<string name="editor_set_line_spacing">Éditeur : définir l'espacement des lignes</string>
|
||||
<string name="empty_file_name">Vous devez définir un nom pour le fichier.</string>
|
||||
<string name="enable_autoreload">Activer le rechargement automatique</string>
|
||||
<string name="enable_color_picker">Activer le sélecteur de couleurs</string>
|
||||
@@ -428,8 +426,6 @@ Redémarrez ecode pour voir les changements.</string>
|
||||
<string name="inspect_widgets">Inspecter les widgets</string>
|
||||
<string name="issues">Problèmes</string>
|
||||
<string name="issues_capitalized">Problèmes</string>
|
||||
<string name="it_must_be_a_single_character">Un seul caractère est autorisé</string>
|
||||
<string name="jump_lines_down">Sauter des lignes vers le bas</string>
|
||||
<string name="jump_lines_up">Sauter des lignes vers le haut</string>
|
||||
<string name="keep_indentation">Conserver l'indentation</string>
|
||||
<string name="key_bindings">Raccourcis clavier</string>
|
||||
@@ -533,8 +529,6 @@ Redémarrez ecode pour voir les modifications.</string>
|
||||
<string name="new_terminal_name">Nouveau nom de terminal :</string>
|
||||
<string name="new_ui_language">Nouvelle langue attribuée.
|
||||
Veuillez redémarrer l'application pour voir les changements complets.</string>
|
||||
<string name="new_ui_scale_factor">Nouveau facteur d'échelle de l'interface utilisateur attribué.
|
||||
Veuillez redémarrer l'application.</string>
|
||||
<string name="new_value">Nouvelle valeur</string>
|
||||
<string name="new_window">Nouvelle fenêtre</string>
|
||||
<string name="next">Suivant</string>
|
||||
@@ -707,24 +701,8 @@ Veuillez vérifier que le répertoire de l'application dispose des autorisations
|
||||
<string name="session_snapshot_desc">Lorsque la capture instantanée de session est activée, l'éditeur conservera
|
||||
les modifications du tampon du document entre les sessions, même si elles ne sont pas enregistrées
|
||||
avant de quitter le programme.</string>
|
||||
<string name="set_cursor_blinking_time">Définir le temps de clignotement du curseur :
|
||||
Choisir 0 pour le désactiver.</string>
|
||||
<string name="set_editor_font_size">Définir la taille de la police de l'éditeur :</string>
|
||||
<string name="set_fold_refresh_frequency">Définir la fréquence d'actualisation des pliages de code :
|
||||
Elle doit être supérieure à 1 seconde.
|
||||
Les pliages ne sont actualisés qu'après toute modification du document.</string>
|
||||
<string name="set_frame_rate_limit">Définir la limite de fréquence d'images :
|
||||
Choisir 0 pour la désactiver.</string>
|
||||
<string name="set_indent_tab_character">Définir le caractère utilisé pour le marqueur d'indentation.</string>
|
||||
<string name="set_line_breaking_column">Définir la colonne de saut de ligne :
|
||||
Choisir 0 pour la désactiver.</string>
|
||||
<string name="set_line_spacing">Définir l'espacement des lignes :
|
||||
Choisir 0 pour le désactiver.</string>
|
||||
<string name="set_side_panel_font_size">Définir la taille de la police du panneau latéral :</string>
|
||||
<string name="set_terminal_font_size">Définir la taille de la police du terminal :</string>
|
||||
<string name="set_ui_font_size">Définir la taille de la police de l'interface utilisateur :</string>
|
||||
<string name="set_ui_scale_factor">Définir le facteur d'échelle de l'interface utilisateur (densité de pixels) :
|
||||
La valeur minimale est 1 et le maximum est 6. Nécessite un redémarrage.</string>
|
||||
<string name="settings">Paramètres</string>
|
||||
<string name="shell">Shell</string>
|
||||
<string name="shell_configuration">Configuration du shell</string>
|
||||
@@ -844,6 +822,7 @@ dans l'arborescence de répertoires ainsi que dans les boites de dialogues de s
|
||||
<string name="type_to_locate">Type à localiser</string>
|
||||
<string name="ui_font_and_size_ellipsis">Police et taille de l'interface utilisateur...</string>
|
||||
<string name="ui_font_size">Interface utilisateur : taille de la police</string>
|
||||
<string name="ui_font_features">Fonctionnalités de la police de l'interface</string>
|
||||
<string name="ui_language">Interface utilisateur : langue</string>
|
||||
<string name="ui_multisamples_level">Interface utilisateur : niveau d'anti-aliasing multiéchantillon</string>
|
||||
<string name="ui_panel_font_size">Interface utilisateur : taille de police des panneaux</string>
|
||||
@@ -930,13 +909,7 @@ Redémarrer ecode pour voir les changements.</string>
|
||||
<string name="screenshot_filename_pattern">Modèle de nom de fichier</string>
|
||||
<string name="screenshot_save_format">Format d’enregistrement</string>
|
||||
<string name="set_screenshot_filename_pattern">Définir le modèle de nom des captures d’écran</string>
|
||||
<string name="set_screenshot_filename_pattern_message">Définissez le modèle de nom des captures d’écran :
|
||||
Utilise les spécificateurs de format strftime. L’extension du fichier correspond au format de capture sélectionné.</string>
|
||||
<string name="set_screenshot_save_format">Définir le format des captures d’écran</string>
|
||||
<string name="set_screenshot_save_format_message">Sélectionnez le format d’enregistrement des captures d’écran :</string>
|
||||
<string name="invalid_screenshot_filename_pattern">Le modèle de nom des captures d’écran n’est pas valide.</string>
|
||||
<string name="invalid_screenshot_save_format">Le format d’enregistrement des captures d’écran n’est pas valide.</string>
|
||||
<string name="couldnt_create_screenshot_directory">Impossible de créer le dossier des captures d’écran.</string>
|
||||
<string name="couldnt_find_available_screenshot_filename">Impossible de trouver un nom de fichier disponible pour la capture d’écran.</string>
|
||||
<string name="couldnt_save_screenshot">Impossible d’enregistrer la capture d’écran.</string>
|
||||
<string name="screenshot_saved">Capture d’écran enregistrée :</string>
|
||||
@@ -951,6 +924,8 @@ Utilise les spécificateurs de format strftime. L’extension du fichier corresp
|
||||
<string name="set_tab_out_characters_message">Définissez les caractères que le curseur peut franchir en appuyant sur Tab.</string>
|
||||
<string name="open_settings_ellipsis">Ouvrir les paramètres...</string>
|
||||
<string name="open_project_settings_ellipsis">Ouvrir les paramètres du projet...</string>
|
||||
<string name="open_document_settings">Ouvrir les paramètres du document</string>
|
||||
<string name="open_terminal_settings">Ouvrir les paramètres du terminal</string>
|
||||
<string name="project_settings">Paramètres du projet</string>
|
||||
<string name="search_settings">Rechercher dans les paramètres...</string>
|
||||
<string name="show_line_numbers_desc">Afficher les numéros de ligne à côté de l'éditeur.</string>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<string name="author">作者</string>
|
||||
<string name="auto_close_brackets_and_tags">Auto-Close Brackets & Tags</string>
|
||||
<string name="auto_close_xml_tags">自动关闭XML标签</string>
|
||||
<string name="auto_close_brackets_and_tags">自动闭合括号和标签</string>
|
||||
<string name="auto_detect_indent_type_and_width">Auto Detect Indent Type & Width</string>
|
||||
<string name="back_quotes">Back Quotes ``</string>
|
||||
<string name="brackets">括号()</string>
|
||||
@@ -197,12 +198,9 @@
|
||||
<string name="discretionary_ligatures">任意连字 (dlig)</string>
|
||||
<string name="discretionary_ligatures_desc">字体提供的可选装饰性或风格化连字。</string>
|
||||
<string name="editor_font_size">编辑器字体大小</string>
|
||||
<string name="editor_font_features">编辑器字体特性</string>
|
||||
<string name="editor_go_back">编辑器撤销</string>
|
||||
<string name="editor_go_forward">编辑器重做</string>
|
||||
<string name="editor_set_cursor_blinking_time">编辑器设置光标闪烁时间</string>
|
||||
<string name="editor_set_line_breaking_column">编辑器设置打断行</string>
|
||||
<string name="editor_set_line_spacing">Editor Set Line Spacing</string>
|
||||
<string name="empty_file_name">请给文件取名。</string>
|
||||
<string name="enable_color_picker">开启颜色选择器</string>
|
||||
<string name="enable_color_picker_tooltip">开启颜色选择工具
|
||||
当光标悬浮在颜色字符串上时</string>
|
||||
@@ -416,8 +414,6 @@ Restart ecode to see the changes.</string>
|
||||
<string name="new_terminal_name">新终端名称:</string>
|
||||
<string name="new_ui_language">语言已设置New Lang assigned.
|
||||
请重启Ecode以应用更改。Please Restart Ecode.</string>
|
||||
<string name="new_ui_scale_factor">新的UI缩放已设置。
|
||||
请重启Ecode以应用更改。</string>
|
||||
<string name="new_value">新值</string>
|
||||
<string name="new_window">新建窗口</string>
|
||||
<string name="next">下一个</string>
|
||||
@@ -536,22 +532,6 @@ Restart ecode to see the changes.</string>
|
||||
<string name="select_to_previous_line">选择上一行</string>
|
||||
<string name="sans-serif_font">Sans-Serif字体</string>
|
||||
<string name="sans-serif_font_ellipsis">Sans-Serif字体...</string>
|
||||
<string name="set_cursor_blinking_time">设置光标闪烁时间:设置0禁用
|
||||
</string>
|
||||
<string name="set_editor_font_size">设置字体大小:</string>
|
||||
<string name="set_frame_rate_limit">设置FPS限制:设置0禁用
|
||||
</string>
|
||||
<string name="set_line_breaking_column">设置断点行:
|
||||
设为0禁用
|
||||
</string>
|
||||
<string name="set_line_spacing">Set Line Spacing:
|
||||
设为0禁用
|
||||
</string>
|
||||
<string name="set_side_panel_font_size">设置侧边字体大小:</string>
|
||||
<string name="set_terminal_font_size">设置终端字体大小:</string>
|
||||
<string name="set_ui_font_size">设置UI字体大小:</string>
|
||||
<string name="set_ui_scale_factor">设置按像素的UI缩放:
|
||||
最小1,最大6,需要重启Ecode</string>
|
||||
<string name="shell">外壳</string>
|
||||
<string name="shell_configuration">外壳设置</string>
|
||||
<string name="show_build_tab">显示构建页</string>
|
||||
@@ -642,6 +622,7 @@ file in the directory tree.</string>
|
||||
<string name="type_to_locate">Type to Locate</string>
|
||||
<string name="ui_font_and_size_ellipsis">界面字体和大小...</string>
|
||||
<string name="ui_font_size">Ui字体大小</string>
|
||||
<string name="ui_font_features">界面字体特性</string>
|
||||
<string name="ui_language">界面语言</string>
|
||||
<string name="ui_multisamples_level">多重采样抗锯齿级别</string>
|
||||
<string name="ui_panel_font_size">界面面板字体大小</string>
|
||||
@@ -709,13 +690,7 @@ file in the directory tree.</string>
|
||||
<string name="screenshot_filename_pattern">文件名格式</string>
|
||||
<string name="screenshot_save_format">保存格式</string>
|
||||
<string name="set_screenshot_filename_pattern">设置屏幕截图文件名格式</string>
|
||||
<string name="set_screenshot_filename_pattern_message">设置屏幕截图文件名格式:
|
||||
使用 strftime 格式说明符。文件扩展名由所选屏幕截图格式决定。</string>
|
||||
<string name="set_screenshot_save_format">设置屏幕截图保存格式</string>
|
||||
<string name="set_screenshot_save_format_message">选择屏幕截图保存格式:</string>
|
||||
<string name="invalid_screenshot_filename_pattern">屏幕截图文件名格式无效。</string>
|
||||
<string name="invalid_screenshot_save_format">屏幕截图保存格式无效。</string>
|
||||
<string name="couldnt_create_screenshot_directory">无法创建屏幕截图目录。</string>
|
||||
<string name="couldnt_find_available_screenshot_filename">无法找到可用的屏幕截图文件名。</string>
|
||||
<string name="couldnt_save_screenshot">无法保存屏幕截图。</string>
|
||||
<string name="screenshot_saved">屏幕截图已保存:</string>
|
||||
@@ -730,6 +705,8 @@ file in the directory tree.</string>
|
||||
<string name="set_tab_out_characters_message">设置按 Tab 时光标可以跳过的字符。</string>
|
||||
<string name="open_settings_ellipsis">打开设置...</string>
|
||||
<string name="open_project_settings_ellipsis">打开项目设置...</string>
|
||||
<string name="open_document_settings">打开文档设置</string>
|
||||
<string name="open_terminal_settings">打开终端设置</string>
|
||||
<string name="project_settings">项目设置</string>
|
||||
<string name="search_settings">搜索设置...</string>
|
||||
<string name="show_line_numbers_desc">在编辑器旁显示行号。</string>
|
||||
|
||||
@@ -2181,9 +2181,6 @@ std::map<std::string, std::string> App::getMigrateKeybindings() {
|
||||
std::vector<std::string> App::getUnlockedCommands() {
|
||||
return {
|
||||
"take-screenshot",
|
||||
"screenshot-save-path",
|
||||
"screenshot-filename-pattern",
|
||||
"screenshot-save-format",
|
||||
"create-new",
|
||||
"create-new-terminal",
|
||||
"create-new-welcome-tab",
|
||||
@@ -2211,6 +2208,8 @@ std::vector<std::string> App::getUnlockedCommands() {
|
||||
"menu-toggle",
|
||||
"open-settings",
|
||||
"open-project-settings",
|
||||
"open-document-settings",
|
||||
"open-terminal-settings",
|
||||
"switch-side-panel",
|
||||
"toggle-status-bar",
|
||||
"download-file-web",
|
||||
@@ -2226,20 +2225,11 @@ std::vector<std::string> App::getUnlockedCommands() {
|
||||
"debug-draw-highlight-toggle",
|
||||
"debug-draw-boxes-toggle",
|
||||
"debug-draw-debug-data",
|
||||
"editor-set-line-breaking-column",
|
||||
"editor-set-line-spacing",
|
||||
"editor-set-cursor-blinking-time",
|
||||
"editor-set-indent-tab-character",
|
||||
"check-for-updates",
|
||||
"keybindings",
|
||||
"about-ecode",
|
||||
"ecode-source",
|
||||
"ui-scale-factor",
|
||||
"show-side-panel",
|
||||
"editor-font-size",
|
||||
"terminal-font-size",
|
||||
"ui-font-size",
|
||||
"ui-panel-font-size",
|
||||
"sans-serif-font",
|
||||
"editor-font",
|
||||
"terminal-font",
|
||||
@@ -2251,8 +2241,8 @@ std::vector<std::string> App::getUnlockedCommands() {
|
||||
"show-folder-treeview-tab",
|
||||
"show-build-tab",
|
||||
"create-new-window",
|
||||
"reset-global-language-extensions-priorities",
|
||||
"reset-project-language-extensions-priorities",
|
||||
"reset-global-file-associations",
|
||||
"reset-project-file-associations",
|
||||
"maximize-tab-widget",
|
||||
"restore-maximized-tab-widget",
|
||||
"close-folder",
|
||||
@@ -2397,7 +2387,6 @@ void App::createDocDirtyAlert( UICodeEditor* editor, bool showEnableAutoReload )
|
||||
docAlert->close();
|
||||
editor->setFocus();
|
||||
mConfig.editor.autoReloadOnDiskChange = true;
|
||||
mSettings->updateGlobalDocumentSettingsMenu();
|
||||
} );
|
||||
|
||||
docAlert->find( "file_reload" )->onClick( [editor, docAlert]( const MouseEvent* ) {
|
||||
@@ -3598,10 +3587,10 @@ void App::toggleSettingsMenu() {
|
||||
mSettings->toggleSettingsMenu();
|
||||
}
|
||||
|
||||
void App::openSettings() {
|
||||
void App::openSettings( const std::string& category ) {
|
||||
if ( !mSettingsPanel )
|
||||
mSettingsPanel = std::make_unique<SettingsPanel>( this );
|
||||
mSettingsPanel->show( SettingsPanel::Scope::User );
|
||||
mSettingsPanel->show( SettingsPanel::Scope::User, category );
|
||||
}
|
||||
|
||||
void App::openProjectSettings() {
|
||||
|
||||
@@ -216,7 +216,7 @@ class App : public UICodeEditorSplitter::Client, public PluginContextProvider {
|
||||
|
||||
void toggleSettingsMenu();
|
||||
|
||||
void openSettings();
|
||||
void openSettings( const std::string& category = {} );
|
||||
|
||||
void openProjectSettings();
|
||||
|
||||
@@ -249,6 +249,8 @@ class App : public UICodeEditorSplitter::Client, public PluginContextProvider {
|
||||
t.setCommand( "debug-widget-tree-view", [this] { createWidgetInspector(); } );
|
||||
t.setCommand( "menu-toggle", [this] { toggleSettingsMenu(); } );
|
||||
t.setCommand( "open-settings", [this] { openSettings(); } );
|
||||
t.setCommand( "open-document-settings", [this] { openSettings( "editor.document" ); } );
|
||||
t.setCommand( "open-terminal-settings", [this] { openSettings( "terminal.*" ); } );
|
||||
t.setCommand( "open-project-settings", [this] { openProjectSettings(); } );
|
||||
t.setCommand( "switch-side-panel", [this] { switchSidePanel(); } );
|
||||
t.setCommand( "download-file-web", [this] { downloadFileWebDialog(); } );
|
||||
@@ -344,31 +346,13 @@ class App : public UICodeEditorSplitter::Client, public PluginContextProvider {
|
||||
[this] { mUniversalLocator->showWorkspaceSymbol(); } );
|
||||
t.setCommand( "open-document-symbol-search",
|
||||
[this] { mUniversalLocator->showDocumentSymbol(); } );
|
||||
t.setCommand( "editor-set-line-breaking-column",
|
||||
[this] { mSettingsActions->setLineBreakingColumn(); } );
|
||||
t.setCommand( "editor-set-line-spacing", [this] { mSettingsActions->setLineSpacing(); } );
|
||||
t.setCommand( "editor-set-cursor-blinking-time",
|
||||
[this] { mSettingsActions->setCursorBlinkingTime(); } );
|
||||
t.setCommand( "editor-set-indent-tab-character",
|
||||
[this] { mSettingsActions->setIndentTabCharacter(); } );
|
||||
t.setCommand( "check-for-updates", [this] { mSettingsActions->checkForUpdates(); } );
|
||||
t.setCommand( "about-ecode", [this] { mSettingsActions->aboutEcode(); } );
|
||||
t.setCommand( "ecode-source", [this] { mSettingsActions->ecodeSource(); } );
|
||||
t.setCommand( "ui-scale-factor", [this] { mSettingsActions->setUIScaleFactor(); } );
|
||||
t.setCommand( "take-screenshot", [this] { takeScreenshot(); } );
|
||||
t.setCommand( "screenshot-save-path",
|
||||
[this] { mSettingsActions->setScreenshotSavePath(); } );
|
||||
t.setCommand( "screenshot-filename-pattern",
|
||||
[this] { mSettingsActions->setScreenshotFilenamePattern(); } );
|
||||
t.setCommand( "screenshot-save-format",
|
||||
[this] { mSettingsActions->setScreenshotSaveFormat(); } );
|
||||
t.setCommand( "show-side-panel", [this] { switchSidePanel(); } );
|
||||
t.setCommand( "toggle-status-bar", [this] { switchStatusBar(); } );
|
||||
t.setCommand( "toggle-menu-bar", [this] { switchMenuBar(); } );
|
||||
t.setCommand( "editor-font-size", [this] { mSettingsActions->setEditorFontSize(); } );
|
||||
t.setCommand( "terminal-font-size", [this] { mSettingsActions->setTerminalFontSize(); } );
|
||||
t.setCommand( "ui-font-size", [this] { mSettingsActions->setUIFontSize(); } );
|
||||
t.setCommand( "ui-panel-font-size", [this] { mSettingsActions->setUIPanelFontSize(); } );
|
||||
t.setCommand( "sans-serif-font",
|
||||
[this] { openFontDialog( mConfig.ui.sansSerifFont, false ); } );
|
||||
t.setCommand( "editor-font", [this] { openFontDialog( mConfig.ui.monospaceFont, true ); } );
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
#include "settingsactions.hpp"
|
||||
#include "datetimecontroller.hpp"
|
||||
#include "ecode.hpp"
|
||||
#include "version.hpp"
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
namespace ecode {
|
||||
|
||||
void SettingsActions::checkForUpdatesResponse( Http::Response&& response, bool fromStartup ) {
|
||||
@@ -143,204 +140,6 @@ void SettingsActions::ecodeSource() {
|
||||
Engine::instance()->openURI( "https://github.com/SpartanJ/ecode" );
|
||||
}
|
||||
|
||||
void SettingsActions::setLineBreakingColumn() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT,
|
||||
i18n( "set_line_breaking_column", "Set Line Breaking Column:\nSet 0 to disable it.\n" )
|
||||
.unescape() );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->getTextInput()->setAllowOnlyNumbers( true, false );
|
||||
msgBox->getTextInput()->setText( String::toString( mApp->getConfig().doc.lineBreakingColumn ) );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
int val;
|
||||
if ( String::fromString( val, msgBox->getTextInput()->getText() ) && val >= 0 ) {
|
||||
mApp->getConfig().doc.lineBreakingColumn = val;
|
||||
mApp->getSplitter()->forEachEditor(
|
||||
[val]( UICodeEditor* editor ) { editor->setLineBreakingColumn( val ); } );
|
||||
msgBox->closeWindow();
|
||||
}
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setLineSpacing() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT,
|
||||
i18n( "set_line_spacing", "Set Line Spacing:\nSet 0 to disable it.\n" ).unescape() );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().editor.lineSpacing.toString() );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
mApp->getConfig().editor.lineSpacing =
|
||||
StyleSheetLength( msgBox->getTextInput()->getText() );
|
||||
mApp->getSplitter()->forEachEditor( [this]( UICodeEditor* editor ) {
|
||||
editor->setLineSpacing( mApp->getConfig().editor.lineSpacing );
|
||||
} );
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setCursorBlinkingTime() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT,
|
||||
i18n( "set_cursor_blinking_time", "Set Cursor Blinking Time:\nSet 0 to disable it.\n" )
|
||||
.unescape() );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().editor.cursorBlinkingTime.toString() );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
mApp->getConfig().editor.cursorBlinkingTime =
|
||||
Time::fromString( msgBox->getTextInput()->getText().toUtf8() );
|
||||
mApp->getSplitter()->forEachEditor( [this]( UICodeEditor* editor ) {
|
||||
editor->setCursorBlinkTime( mApp->getConfig().editor.cursorBlinkingTime );
|
||||
} );
|
||||
msgBox->closeWindow();
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setIndentTabCharacter() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::COMBOBOX,
|
||||
i18n( "set_indent_tab_character", "Set the tab indentation guide character displayed." ) );
|
||||
msgBox->setId( "indent_tab_window" );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
UIComboBox* comboBox = msgBox->getComboBox();
|
||||
UIListBox* listBox = msgBox->getComboBox()->getDropDownList()->getListBox();
|
||||
listBox->addClass( "indent_tab_listbox_item" );
|
||||
listBox->addListBoxItems( { u8"»"s, u8"→"s, u8"⇒"s, u8"↪"s, u8"⇢"s, u8"↣"s } );
|
||||
msgBox->getComboBox()->setText(
|
||||
mApp->getConfig().editor.tabIndentCharacter.empty()
|
||||
? String( u8"»"s )
|
||||
: String::fromUtf8( mApp->getConfig().editor.tabIndentCharacter ) );
|
||||
msgBox->showWhenReady();
|
||||
comboBox->on( Event::OnValueChange, [this, comboBox]( const Event* ) {
|
||||
if ( comboBox->getText().size() != 1 )
|
||||
return;
|
||||
mApp->getSplitter()->forEachEditor( [comboBox]( UICodeEditor* editor ) {
|
||||
editor->setTabIndentCharacter( comboBox->getText()[0] );
|
||||
} );
|
||||
} );
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
auto txt( msgBox->getComboBox()->getText() );
|
||||
if ( txt.size() == 1 ) {
|
||||
mApp->getConfig().editor.tabIndentCharacter = txt.toUtf8();
|
||||
mApp->getSplitter()->forEachEditor(
|
||||
[txt]( UICodeEditor* editor ) { editor->setTabIndentCharacter( txt[0] ); } );
|
||||
msgBox->closeWindow();
|
||||
} else {
|
||||
UIMessageBox* msgBoxAlert =
|
||||
UIMessageBox::New( UIMessageBox::OK, i18n( "it_must_be_a_single_character",
|
||||
"It must be a single character" ) );
|
||||
msgBoxAlert->setTitle( mApp->getWindowTitle() );
|
||||
msgBoxAlert->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
}
|
||||
} );
|
||||
msgBox->on( Event::OnDiscard, [this]( const Event* ) {
|
||||
String txt = String::fromUtf8( mApp->getConfig().editor.tabIndentCharacter );
|
||||
if ( txt.size() != 1 )
|
||||
return;
|
||||
mApp->getSplitter()->forEachEditor(
|
||||
[&txt]( UICodeEditor* editor ) { editor->setTabIndentCharacter( txt[0] ); } );
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setTabOutChars() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT,
|
||||
i18n( "set_tab_out_characters_message",
|
||||
"Set the characters the cursor can move past when pressing Tab." ) );
|
||||
msgBox->setTitle( i18n( "set_tab_out_characters", "Set Tab Out Characters" ) );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->getTextInput()->setText( String::fromUtf8( mApp->getConfig().doc.tabOutChars ) );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
String chars = msgBox->getTextInput()->getText();
|
||||
mApp->getConfig().doc.tabOutChars = chars.toUtf8();
|
||||
mApp->getSplitter()->forEachEditor(
|
||||
[&chars]( UICodeEditor* editor ) { editor->getDocument().setTabOutChars( chars ); } );
|
||||
msgBox->closeWindow();
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setFoldRefreshFreq() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT,
|
||||
i18n( "set_fold_refresh_frequency",
|
||||
"Set code folds refresh frequency:\nIt should be bigger than 1 second.\nFolds are "
|
||||
"only refreshed after any document modification." )
|
||||
.unescape() );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().editor.codeFoldingRefreshFreq.toString() );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
mApp->getConfig().editor.codeFoldingRefreshFreq =
|
||||
Time::fromString( msgBox->getTextInput()->getText().toUtf8() );
|
||||
if ( mApp->getConfig().editor.codeFoldingRefreshFreq < Seconds( 1 ) )
|
||||
mApp->getConfig().editor.codeFoldingRefreshFreq = Seconds( 1 );
|
||||
mApp->getSplitter()->forEachEditor( [this]( UICodeEditor* editor ) {
|
||||
editor->setFoldsRefreshTime( mApp->getConfig().editor.codeFoldingRefreshFreq );
|
||||
} );
|
||||
msgBox->closeWindow();
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setUIScaleFactor() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT,
|
||||
i18n( "set_ui_scale_factor", "Set the UI scale factor (pixel density):\nMinimum value is "
|
||||
"1, and maximum 6. Requires restart." ) );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->getTextInput()->setText(
|
||||
String::fromFloat( mApp->getConfig().windowState.pixelDensity ) );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
msgBox->closeWindow();
|
||||
Float val;
|
||||
if ( String::fromString( val, msgBox->getTextInput()->getText() ) && val >= 1 &&
|
||||
val <= 6 ) {
|
||||
if ( mApp->getConfig().windowState.pixelDensity != val ) {
|
||||
mApp->getConfig().windowState.pixelDensity = val;
|
||||
UIMessageBox* msg = UIMessageBox::New(
|
||||
UIMessageBox::OK,
|
||||
i18n( "new_ui_scale_factor", "New UI scale factor assigned.\nPlease "
|
||||
"restart the application." ) );
|
||||
msg->showWhenReady();
|
||||
mApp->setFocusEditorOnClose( msg );
|
||||
} else if ( mApp->getSplitter() && mApp->getSplitter()->getCurWidget() ) {
|
||||
mApp->getSplitter()->getCurWidget()->setFocus();
|
||||
}
|
||||
} else {
|
||||
UIMessageBox* msg = UIMessageBox::New( UIMessageBox::OK, "Invalid value!" );
|
||||
msg->showWhenReady();
|
||||
mApp->setFocusEditorOnClose( msg );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void SettingsActions::setEditorFontSize() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT, i18n( "set_editor_font_size", "Set the editor font size:" ) );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().editor.fontSize.toString() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
setEditorFontSize( StyleSheetLength( msgBox->getTextInput()->getText() ) );
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setEditorFontSize( const StyleSheetLength& size ) {
|
||||
mApp->getConfig().editor.fontSize = size;
|
||||
const Float fontSize = size.asPixels( 0, Sizef(), mApp->getDisplayDPI() );
|
||||
@@ -348,19 +147,6 @@ void SettingsActions::setEditorFontSize( const StyleSheetLength& size ) {
|
||||
[fontSize]( UICodeEditor* editor ) { editor->setFontSize( fontSize ); } );
|
||||
}
|
||||
|
||||
void SettingsActions::setTerminalFontSize() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT, i18n( "set_terminal_font_size", "Set the terminal font size:" ) );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().term.fontSize.toString() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
setTerminalFontSize( StyleSheetLength( msgBox->getTextInput()->getText() ) );
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setTerminalFontSize( const StyleSheetLength& size ) {
|
||||
mApp->getConfig().term.fontSize = size;
|
||||
const Float fontSize = size.asPixels( 0, Sizef(), mApp->getDisplayDPI() );
|
||||
@@ -370,20 +156,6 @@ void SettingsActions::setTerminalFontSize( const StyleSheetLength& size ) {
|
||||
} );
|
||||
}
|
||||
|
||||
void SettingsActions::setUIFontSize() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New( UIMessageBox::INPUT,
|
||||
i18n( "set_ui_font_size", "Set the UI font size:" ) );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().ui.fontSize.toString() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
setUIFontSize( StyleSheetLength( msgBox->getTextInput()->getText() ) );
|
||||
msgBox->closeWindow();
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
}
|
||||
|
||||
void SettingsActions::setUIFontSize( const StyleSheetLength& size ) {
|
||||
mApp->getConfig().ui.fontSize = size;
|
||||
const Float fontSize = size.asPixels( 0, Sizef(), mApp->getDisplayDPI() );
|
||||
@@ -400,26 +172,11 @@ void SettingsActions::setUIFontSize( const StyleSheetLength& size ) {
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void SettingsActions::setUIPanelFontSize() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT, i18n( "set_side_panel_font_size", "Set side panel font size:" ) );
|
||||
msgBox->setTitle( mApp->getWindowTitle() );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().ui.panelFontSize.toString() );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
setUIPanelFontSize( StyleSheetLength( msgBox->getTextInput()->getText() ) );
|
||||
msgBox->closeWindow();
|
||||
} );
|
||||
mApp->setFocusEditorOnClose( msgBox );
|
||||
setUIPanelFontSize( mApp->getConfig().ui.panelFontSize );
|
||||
}
|
||||
|
||||
void SettingsActions::setUIPanelFontSize( const StyleSheetLength& size ) {
|
||||
mApp->getConfig().ui.panelFontSize = size;
|
||||
|
||||
// Update the CSS
|
||||
auto selsFound = mApp->getUISceneNode()->getStyleSheet().findStyleFromSelectorName(
|
||||
"#project_view > treeview::row > treeview::cell" );
|
||||
if ( !selsFound.empty() ) {
|
||||
@@ -429,10 +186,10 @@ void SettingsActions::setUIPanelFontSize( const StyleSheetLength& size ) {
|
||||
}
|
||||
|
||||
UITreeView* treeView = mApp->getUISceneNode()->find<UITreeView>( "project_view" );
|
||||
if ( !treeView )
|
||||
return;
|
||||
treeView->reloadStyle( true, true, true, true );
|
||||
treeView->updateContentSize();
|
||||
if ( treeView ) {
|
||||
treeView->reloadStyle( true, true, true, true );
|
||||
treeView->updateContentSize();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsActions::setScreenshotSavePath() {
|
||||
@@ -461,58 +218,6 @@ void SettingsActions::setScreenshotSavePath() {
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void SettingsActions::setScreenshotFilenamePattern() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::INPUT,
|
||||
i18n( "set_screenshot_filename_pattern_message",
|
||||
"Set the screenshot filename pattern:\nUses strftime format specifiers. The file "
|
||||
"extension follows the selected screenshot format." ) );
|
||||
msgBox->setTitle(
|
||||
i18n( "set_screenshot_filename_pattern", "Set Screenshot Filename Pattern" ) );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->getTextInput()->setText( mApp->getConfig().screenshot.filenamePattern );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
std::string pattern = msgBox->getTextInput()->getText().toUtf8();
|
||||
std::string filename = DateTimeController::formatCurrentDate( pattern );
|
||||
if ( !DateTimeController::isValidDateFormat( pattern ) || filename.empty() ||
|
||||
filename.find_first_of( "<>:\"/\\|?*" ) != std::string::npos ) {
|
||||
msgBox->getTextInput()->addClass( "error" );
|
||||
mApp->errorMsgBox( i18n( "invalid_screenshot_filename_pattern",
|
||||
"The screenshot filename pattern is invalid." ) );
|
||||
return;
|
||||
}
|
||||
mApp->getConfig().screenshot.filenamePattern = std::move( pattern );
|
||||
mApp->saveConfig();
|
||||
msgBox->closeWindow();
|
||||
} );
|
||||
}
|
||||
|
||||
void SettingsActions::setScreenshotSaveFormat() {
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::DROPDOWNLIST,
|
||||
i18n( "set_screenshot_save_format_message", "Select the screenshot save format:" ) );
|
||||
msgBox->setTitle( i18n( "set_screenshot_save_format", "Set Screenshot Save Format" ) );
|
||||
msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } );
|
||||
msgBox->getDropDownList()->getListBox()->addListBoxItems(
|
||||
{ "PNG", "JPG", "WEBP", "QOI", "BMP", "TGA", "DDS" } );
|
||||
msgBox->getDropDownList()->getListBox()->setSelected(
|
||||
String( mApp->getConfig().screenshot.saveFormat ).toUpper() );
|
||||
msgBox->showWhenReady();
|
||||
msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) {
|
||||
String formatText( msgBox->getDropDownList()->getText() );
|
||||
std::string format = formatText.toLower().toUtf8();
|
||||
if ( Image::extensionToSaveType( format ) == Image::SaveType::Unknown ) {
|
||||
mApp->errorMsgBox(
|
||||
i18n( "invalid_screenshot_save_format", "Invalid screenshot save format." ) );
|
||||
return;
|
||||
}
|
||||
mApp->getConfig().screenshot.saveFormat = std::move( format );
|
||||
mApp->saveConfig();
|
||||
msgBox->closeWindow();
|
||||
} );
|
||||
}
|
||||
|
||||
String SettingsActions::i18n( const std::string& key, const String& def ) {
|
||||
return mApp->i18n( key, def );
|
||||
}
|
||||
|
||||
@@ -17,38 +17,16 @@ class SettingsActions {
|
||||
|
||||
void ecodeSource();
|
||||
|
||||
void setLineBreakingColumn();
|
||||
|
||||
void setLineSpacing();
|
||||
|
||||
void setCursorBlinkingTime();
|
||||
|
||||
void setIndentTabCharacter();
|
||||
|
||||
void setTabOutChars();
|
||||
|
||||
void setFoldRefreshFreq();
|
||||
|
||||
void setUIScaleFactor();
|
||||
|
||||
void setUIFontSize();
|
||||
void setUIFontSize( const StyleSheetLength& size );
|
||||
|
||||
void setEditorFontSize();
|
||||
void setEditorFontSize( const StyleSheetLength& size );
|
||||
|
||||
void setTerminalFontSize();
|
||||
void setTerminalFontSize( const StyleSheetLength& size );
|
||||
|
||||
void setUIPanelFontSize();
|
||||
void setUIPanelFontSize( const StyleSheetLength& size );
|
||||
|
||||
void setScreenshotSavePath();
|
||||
|
||||
void setScreenshotFilenamePattern();
|
||||
|
||||
void setScreenshotSaveFormat();
|
||||
|
||||
private:
|
||||
App* mApp{ nullptr };
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,24 +30,12 @@ class SettingsMenu {
|
||||
|
||||
UIMenu* createWindowMenu();
|
||||
|
||||
UIMenu* createRendererMenu();
|
||||
|
||||
UIMenu* createViewMenu();
|
||||
|
||||
UIPopUpMenu* createToolsMenu();
|
||||
|
||||
UIMenu* createHelpMenu();
|
||||
|
||||
UIMenu* createThemesMenu();
|
||||
|
||||
UIMenu* createLanguagesMenu();
|
||||
|
||||
UIMenu* createFontHintMenu();
|
||||
|
||||
UIMenu* createFontAntiAliasingMenu();
|
||||
|
||||
UIMenu* createFontsMenu();
|
||||
|
||||
void updateTerminalMenu();
|
||||
|
||||
void updateEditMenu();
|
||||
@@ -60,8 +48,6 @@ class SettingsMenu {
|
||||
|
||||
void updateViewMenu();
|
||||
|
||||
void updateGlobalDocumentSettingsMenu();
|
||||
|
||||
void showProjectTreeMenu();
|
||||
|
||||
void createProjectTreeMenu();
|
||||
@@ -108,33 +94,21 @@ class SettingsMenu {
|
||||
UISceneNode* mUISceneNode{ nullptr };
|
||||
UICodeEditorSplitter* mSplitter{ nullptr };
|
||||
UIPopUpMenu* mDocMenu{ nullptr };
|
||||
UIPopUpMenu* mGlobalMenu{ nullptr };
|
||||
UIPopUpMenu* mTerminalMenu{ nullptr };
|
||||
UIPopUpMenu* mViewMenu{ nullptr };
|
||||
UIPopUpMenu* mWindowMenu{ nullptr };
|
||||
UIPopUpMenu* mRendererMenu{ nullptr };
|
||||
UIPopUpMenu* mToolsMenu{ nullptr };
|
||||
UIPopUpMenu* mProjectTreeMenu{ nullptr };
|
||||
UIPopUpMenu* mProjectDocMenu{ nullptr };
|
||||
UIPopUpMenu* mProjectMenu{ nullptr };
|
||||
UIPopUpMenu* mHExtLanguageTypeMenu{ nullptr };
|
||||
UIPopUpMenu* mEditMenu{ nullptr };
|
||||
UIPopUpMenu* mDateMenu{ nullptr };
|
||||
UIPopUpMenu* mHelpMenu{ nullptr };
|
||||
UIPopUpMenu* mLineWrapMenu{ nullptr };
|
||||
UIPopUpMenu* mCodeFoldingMenu{ nullptr };
|
||||
UIPopUpMenu* mTabBarMenu{ nullptr };
|
||||
UIMenuBar* mMenuBar{ nullptr };
|
||||
UIPopUpMenu* mFontHintMenu{ nullptr };
|
||||
UIPopUpMenu* mFontAntiAliasingMenu{ nullptr };
|
||||
UIPopUpMenu* mFontsMenu{ nullptr };
|
||||
std::vector<UIPopUpMenu*> mFileTypeMenus;
|
||||
Float mFileTypeMenusCreatedWithHeight{ 0 };
|
||||
std::vector<UIPopUpMenu*> mColorSchemeMenus;
|
||||
Float mColorSchemeMenusCreatedWithHeight{ 0 };
|
||||
|
||||
void forEachTerminal( const std::function<void( UITerminal* )> fn );
|
||||
|
||||
void updateDateMenu();
|
||||
|
||||
UITerminal* getCurrentTerminal() const;
|
||||
|
||||
@@ -153,6 +153,13 @@ static constexpr const char* SETTINGS_PANEL_LAYOUT = R"xml(
|
||||
padding-bottom: 6dp;
|
||||
border-bottom: 1dp solid var(--tab-line);
|
||||
}
|
||||
.settings_panel .settings_subcategory_heading {
|
||||
font-size: 12dp;
|
||||
font-weight: bold;
|
||||
margin: 18dp 4dp 3dp 4dp;
|
||||
padding-bottom: 6dp;
|
||||
border-bottom: 1dp solid var(--tab-line);
|
||||
}
|
||||
.settings_panel .settings_option {
|
||||
border-bottom: 1dp solid var(--disabled-border);
|
||||
padding: 9dp 4dp 11dp 4dp;
|
||||
@@ -246,6 +253,9 @@ static constexpr const char* SETTINGS_ROW_LAYOUT = R"xml(
|
||||
static constexpr const char* SETTINGS_CATEGORY_HEADING_LAYOUT = R"xml(
|
||||
<TextView lw="mp" lh="wc" class="settings_category_heading" visible="false" focusable="false" />
|
||||
)xml";
|
||||
static constexpr const char* SETTINGS_SUBCATEGORY_HEADING_LAYOUT = R"xml(
|
||||
<TextView lw="mp" lh="wc" class="settings_subcategory_heading" visible="false" focusable="false" />
|
||||
)xml";
|
||||
static constexpr const char* SETTINGS_BOOL_LAYOUT = R"xml(<CheckBox class="settings_bool" />)xml";
|
||||
static constexpr const char* SETTINGS_CHOICE_LAYOUT =
|
||||
R"xml(<DropDownList class="settings_choice" />)xml";
|
||||
@@ -285,25 +295,58 @@ void SettingsPanel::PanelState::reset() {
|
||||
categorySearchText.clear();
|
||||
categoryTitles.clear();
|
||||
categoryHeadings.clear();
|
||||
subcategoryHeadings.clear();
|
||||
bindings.clear();
|
||||
selectedCategory.clear();
|
||||
categoryFilter.clear();
|
||||
}
|
||||
|
||||
void SettingsPanel::show( Scope scope ) {
|
||||
void SettingsPanel::show( Scope scope, const std::string& category ) {
|
||||
auto& panel = state( scope );
|
||||
if ( panel.window ) {
|
||||
panel.window->show();
|
||||
panel.window->toFront();
|
||||
selectCategory( panel, category );
|
||||
panel.categories->setFocus();
|
||||
return;
|
||||
}
|
||||
Clock c;
|
||||
create( scope );
|
||||
selectCategory( panel, category );
|
||||
Log::info( "Settings Panel %s created in %s", scope == Scope::User ? "User" : "Project",
|
||||
c.getElapsedTime().toString() );
|
||||
}
|
||||
|
||||
void SettingsPanel::selectCategory( PanelState& panel, const std::string& category ) {
|
||||
if ( category.empty() || !panel.categories )
|
||||
return;
|
||||
String title;
|
||||
if ( String::endsWith( category, ".*" ) ) {
|
||||
const std::string prefix = category.substr( 0, category.size() - 1 );
|
||||
for ( const auto& [parent, children] : panel.categoryItems ) {
|
||||
if ( !children.empty() ) {
|
||||
auto id = panel.categoryIds.find( parent + '/' + children.front() );
|
||||
if ( id != panel.categoryIds.end() && String::startsWith( id->second, prefix ) ) {
|
||||
title = String::fromUtf8( parent );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ( auto found = panel.categoryTitles.find( category );
|
||||
found != panel.categoryTitles.end() ) {
|
||||
title = found->second;
|
||||
}
|
||||
if ( title.empty() )
|
||||
return;
|
||||
panel.selectedCategory = category;
|
||||
auto index = panel.categories->findRowWithText(
|
||||
title.toUtf8(), true, UIAbstractView::FindRowWithTextMatchKind::Equals );
|
||||
if ( index.isValid() )
|
||||
panel.categories->setSelection( index );
|
||||
filter( panel );
|
||||
panel.scroll->getVerticalScrollBar()->setValue( 0, false );
|
||||
}
|
||||
|
||||
void SettingsPanel::create( Scope scope ) {
|
||||
auto& panel = state( scope );
|
||||
UIWindow::StyleConfig config{ UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL };
|
||||
@@ -409,6 +452,16 @@ void SettingsPanel::addCategory( PanelState& panel, const std::string& id, const
|
||||
panel.selectedCategory = id;
|
||||
}
|
||||
|
||||
void SettingsPanel::addSubcategoryHeading( PanelState& panel, const std::string& category,
|
||||
const String& name ) {
|
||||
auto* heading =
|
||||
mApp->getUISceneNode()
|
||||
->loadLayoutFromString( SETTINGS_SUBCATEGORY_HEADING_LAYOUT, panel.settings )
|
||||
->asType<UITextView>();
|
||||
heading->setText( name );
|
||||
panel.subcategoryHeadings.push_back( { category, name, heading } );
|
||||
}
|
||||
|
||||
void SettingsPanel::setupCategories( PanelState& panel ) {
|
||||
auto model = SettingsCategoryModel::create( panel.categoryItems, panel.categoryIds );
|
||||
panel.categoryModel = model;
|
||||
@@ -550,22 +603,28 @@ void SettingsPanel::addInteger( PanelState& panel, SettingBinding binding, int m
|
||||
|
||||
void SettingsPanel::addText( PanelState& panel, SettingBinding binding,
|
||||
std::function<std::string()> get,
|
||||
std::function<bool( const std::string& )> set ) {
|
||||
std::function<bool( const std::string& )> set,
|
||||
bool commitOnFocusLoss ) {
|
||||
auto* row = createRow( panel, binding );
|
||||
auto* input = mApp->getUISceneNode()
|
||||
->loadLayoutFromString( SETTINGS_TEXT_LAYOUT,
|
||||
row->find<UILinearLayout>( "setting_control" ) )
|
||||
->asType<UITextInput>();
|
||||
input->setText( String::fromUtf8( get() ) );
|
||||
panel.connections +=
|
||||
input->connect( Event::OnTextChanged, [input, set = std::move( set )]( const Event* ) {
|
||||
std::string text = input->getText().toUtf8();
|
||||
if ( !set( text ) ) {
|
||||
input->addClass( "error" );
|
||||
return;
|
||||
}
|
||||
input->removeClass( "error" );
|
||||
} );
|
||||
auto commit = [input, set = std::move( set )]( const Event* ) {
|
||||
std::string text = input->getText().toUtf8();
|
||||
if ( !set( text ) ) {
|
||||
input->addClass( "error" );
|
||||
return;
|
||||
}
|
||||
input->removeClass( "error" );
|
||||
};
|
||||
if ( commitOnFocusLoss ) {
|
||||
panel.connections += input->connect( Event::OnPressEnter, commit );
|
||||
panel.connections += input->connect( Event::OnFocusLoss, std::move( commit ) );
|
||||
} else {
|
||||
panel.connections += input->connect( Event::OnTextChanged, std::move( commit ) );
|
||||
}
|
||||
panel.bindings.emplace_back( std::move( binding ) );
|
||||
}
|
||||
|
||||
@@ -1069,16 +1128,20 @@ void SettingsPanel::addUserSettings( PanelState& panel ) {
|
||||
? TextFormat::LineEnding::CRLF
|
||||
: ( selected == 2 ? TextFormat::LineEnding::CR : TextFormat::LineEnding::LF );
|
||||
} );
|
||||
const String autoCloseGroup =
|
||||
mApp->i18n( "auto_close_brackets_and_tags", "Auto-Close Brackets & Tags" );
|
||||
addSubcategoryHeading( panel, "editor.document", autoCloseGroup );
|
||||
addBool( panel,
|
||||
{ "autoCloseXMLTags", "editor.document",
|
||||
mApp->i18n( "auto_close_xml_tags", "Auto Close XML Tags" ),
|
||||
mApp->i18n( "auto_close_xml_tags_desc", "Automatically insert closing XML tags." ) },
|
||||
mApp->i18n( "auto_close_xml_tags_desc", "Automatically insert closing XML tags." ),
|
||||
autoCloseGroup },
|
||||
&mApp->getConfig().editor.autoCloseXMLTags, [this]( bool value ) {
|
||||
mApp->getSplitter()->forEachEditor(
|
||||
[value]( UICodeEditor* editor ) { editor->setAutoCloseXMLTags( value ); } );
|
||||
} );
|
||||
auto addAutoClosePair = [this, &panel]( std::string id, const char* nameKey, const char* name,
|
||||
std::string pair ) {
|
||||
auto addAutoClosePair = [this, &panel, &autoCloseGroup]( std::string id, const char* nameKey,
|
||||
const char* name, std::string pair ) {
|
||||
auto containsPair = [this, pair] {
|
||||
auto pairs = String::split( mApp->getConfig().editor.autoCloseBrackets, ',' );
|
||||
return std::find( pairs.begin(), pairs.end(), pair ) != pairs.end();
|
||||
@@ -1086,7 +1149,8 @@ void SettingsPanel::addUserSettings( PanelState& panel ) {
|
||||
addBool( panel,
|
||||
{ std::move( id ), "editor.document", mApp->i18n( nameKey, name ),
|
||||
mApp->i18n( "auto_close_pair_desc",
|
||||
"Automatically insert the matching closing character." ) },
|
||||
"Automatically insert the matching closing character." ),
|
||||
autoCloseGroup },
|
||||
std::move( containsPair ), [this, pair = std::move( pair )]( bool enabled ) {
|
||||
auto pairs = String::split( mApp->getConfig().editor.autoCloseBrackets, ',' );
|
||||
auto found = std::find( pairs.begin(), pairs.end(), pair );
|
||||
@@ -1273,13 +1337,15 @@ void SettingsPanel::addUserSettings( PanelState& panel ) {
|
||||
[this] { mApp->runCommand( "fallback-font" ); } );
|
||||
auto addFontSize = [this, &panel]( SettingBinding binding, std::function<std::string()> get,
|
||||
std::function<void( const StyleSheetLength& )> set ) {
|
||||
addText( panel, std::move( binding ), std::move( get ),
|
||||
[set = std::move( set )]( const std::string& text ) {
|
||||
if ( !StyleSheetLength::isLength( text ) )
|
||||
return false;
|
||||
set( StyleSheetLength::fromString( text ) );
|
||||
return true;
|
||||
} );
|
||||
addText(
|
||||
panel, std::move( binding ), std::move( get ),
|
||||
[set = std::move( set )]( const std::string& text ) {
|
||||
if ( !StyleSheetLength::isLength( text ) )
|
||||
return false;
|
||||
set( StyleSheetLength::fromString( text ) );
|
||||
return true;
|
||||
},
|
||||
true );
|
||||
};
|
||||
addFontSize(
|
||||
{ "uiFontSize", "appearance.fonts", mApp->i18n( "ui_font_size", "UI Font Size" ),
|
||||
@@ -1364,11 +1430,12 @@ void SettingsPanel::addUserSettings( PanelState& panel ) {
|
||||
} );
|
||||
auto addFontFeature = [this, &panel]( std::string id, const char* nameKey, const char* name,
|
||||
const char* descriptionKey, const char* description,
|
||||
Uint32 feature, bool editorFeature ) {
|
||||
Uint32 feature, bool editorFeature,
|
||||
const String& group ) {
|
||||
addBool(
|
||||
panel,
|
||||
{ std::move( id ), "appearance.fonts", mApp->i18n( nameKey, name ),
|
||||
mApp->i18n( descriptionKey, description ) },
|
||||
mApp->i18n( descriptionKey, description ), group },
|
||||
[this, feature, editorFeature] {
|
||||
const Uint32 features = editorFeature ? mApp->getConfig().editor.fontFeatures
|
||||
: mApp->getConfig().ui.fontFeatures;
|
||||
@@ -1392,22 +1459,26 @@ void SettingsPanel::addUserSettings( PanelState& panel ) {
|
||||
};
|
||||
for ( bool editorFeature : { false, true } ) {
|
||||
const std::string prefix = editorFeature ? "editor" : "ui";
|
||||
const String group = editorFeature
|
||||
? mApp->i18n( "editor_font_features", "Editor Font Features" )
|
||||
: mApp->i18n( "ui_font_features", "UI Font Features" );
|
||||
addSubcategoryHeading( panel, "appearance.fonts", group );
|
||||
addFontFeature( prefix + "StandardLigatures", "standard_ligatures",
|
||||
"Standard Ligatures (liga)", "standard_ligatures_desc",
|
||||
"Typographic combinations such as fi, fl, and ffi, depending on the font.",
|
||||
TextHints::StandardLigatures, editorFeature );
|
||||
TextHints::StandardLigatures, editorFeature, group );
|
||||
addFontFeature( prefix + "ContextualAlternates", "contextual_alternates",
|
||||
"Contextual Alternates (calt)", "contextual_alternates_desc",
|
||||
"Context-dependent alternatives, including many programming ligatures.",
|
||||
TextHints::ContextualAlternates, editorFeature );
|
||||
TextHints::ContextualAlternates, editorFeature, group );
|
||||
addFontFeature( prefix + "ContextualLigatures", "contextual_ligatures",
|
||||
"Contextual Ligatures (clig)", "contextual_ligatures_desc",
|
||||
"Ligatures applied in specific contexts to improve readability.",
|
||||
TextHints::ContextualLigatures, editorFeature );
|
||||
TextHints::ContextualLigatures, editorFeature, group );
|
||||
addFontFeature( prefix + "DiscretionaryLigatures", "discretionary_ligatures",
|
||||
"Discretionary Ligatures (dlig)", "discretionary_ligatures_desc",
|
||||
"Optional decorative or stylistic ligatures provided by the font.",
|
||||
TextHints::DiscretionaryLigatures, editorFeature );
|
||||
TextHints::DiscretionaryLigatures, editorFeature, group );
|
||||
}
|
||||
|
||||
addCategory( panel, "editor.advanced", mApp->i18n( "editor", "Editor" ),
|
||||
@@ -1968,7 +2039,7 @@ void SettingsPanel::addProjectSettings( PanelState& panel ) {
|
||||
HExtLanguageType::ObjectiveC, HExtLanguageType::ObjectiveCPP };
|
||||
auto value = values[std::min( selected, size_t{ 4 } )];
|
||||
mApp->getProjectConfig().hExtLanguageType = value;
|
||||
mApp->getSplitter()->forEachEditor( [this, value]( UICodeEditor* editor ) {
|
||||
mApp->getSplitter()->forEachEditor( [value]( UICodeEditor* editor ) {
|
||||
auto& document = editor->getDocument();
|
||||
document.setHExtLanguageType( value );
|
||||
if ( document.getFileInfo().getExtension() == "h" ) {
|
||||
@@ -1997,6 +2068,7 @@ void SettingsPanel::filter( PanelState& panel ) {
|
||||
for ( const auto& binding : panel.bindings ) {
|
||||
if ( String::icontains( binding.name, query ) ||
|
||||
String::icontains( binding.description, query ) ||
|
||||
String::icontains( binding.group, query ) ||
|
||||
String::icontains( binding.id, queryUtf8 ) )
|
||||
matchingCategories.insert( binding.category );
|
||||
}
|
||||
@@ -2020,9 +2092,18 @@ void SettingsPanel::filter( PanelState& panel ) {
|
||||
( aggregate && String::startsWith( binding.category, aggregatePrefix ) )
|
||||
: categoryMatches || String::icontains( binding.name, query ) ||
|
||||
String::icontains( binding.description, query ) ||
|
||||
String::icontains( binding.group, query ) ||
|
||||
String::icontains( binding.id, queryUtf8 );
|
||||
binding.row->setVisible( matches );
|
||||
}
|
||||
for ( auto& subcategory : panel.subcategoryHeadings ) {
|
||||
const bool hasVisibleSetting = std::any_of(
|
||||
panel.bindings.begin(), panel.bindings.end(), [&subcategory]( const auto& binding ) {
|
||||
return binding.category == subcategory.category &&
|
||||
binding.group == subcategory.name && binding.row && binding.row->isVisible();
|
||||
} );
|
||||
subcategory.heading->setVisible( hasVisibleSetting );
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ecode
|
||||
|
||||
@@ -16,7 +16,7 @@ class SettingsPanel {
|
||||
|
||||
explicit SettingsPanel( App* app );
|
||||
|
||||
void show( Scope scope );
|
||||
void show( Scope scope, const std::string& category = {} );
|
||||
|
||||
protected:
|
||||
struct SettingBinding {
|
||||
@@ -24,8 +24,14 @@ class SettingsPanel {
|
||||
std::string category;
|
||||
String name;
|
||||
String description;
|
||||
String group;
|
||||
UIWidget* row{ nullptr };
|
||||
};
|
||||
struct SubcategoryHeading {
|
||||
std::string category;
|
||||
String name;
|
||||
UITextView* heading{ nullptr };
|
||||
};
|
||||
|
||||
struct PanelState {
|
||||
UIWindow* window{ nullptr };
|
||||
@@ -42,6 +48,7 @@ class SettingsPanel {
|
||||
UnorderedMap<std::string, String> categorySearchText;
|
||||
UnorderedMap<std::string, String> categoryTitles;
|
||||
UnorderedMap<std::string, UITextView*> categoryHeadings;
|
||||
std::vector<SubcategoryHeading> subcategoryHeadings;
|
||||
std::vector<SettingBinding> bindings;
|
||||
std::string selectedCategory;
|
||||
std::string categoryFilter;
|
||||
@@ -55,10 +62,13 @@ class SettingsPanel {
|
||||
|
||||
PanelState& state( Scope scope );
|
||||
void create( Scope scope );
|
||||
void selectCategory( PanelState& state, const std::string& category );
|
||||
void addUserSettings( PanelState& state );
|
||||
void addProjectSettings( PanelState& state );
|
||||
void addCategory( PanelState& state, const std::string& id, const String& parent,
|
||||
const String& name );
|
||||
void addSubcategoryHeading( PanelState& state, const std::string& category,
|
||||
const String& name );
|
||||
void setupCategories( PanelState& state );
|
||||
void addBool( PanelState& state, SettingBinding binding, bool* value,
|
||||
std::function<void( bool )> apply = {} );
|
||||
@@ -73,7 +83,7 @@ class SettingsPanel {
|
||||
void addInteger( PanelState& state, SettingBinding binding, int min, int max,
|
||||
std::function<int()> get, std::function<void( int )> set );
|
||||
void addText( PanelState& state, SettingBinding binding, std::function<std::string()> get,
|
||||
std::function<bool( const std::string& )> set );
|
||||
std::function<bool( const std::string& )> set, bool commitOnFocusLoss = false );
|
||||
void addFloat( PanelState& state, SettingBinding binding, double min, double max, double step,
|
||||
std::function<double()> get, std::function<void( double )> set );
|
||||
void addAction( PanelState& state, SettingBinding binding, const String& buttonText,
|
||||
|
||||
Reference in New Issue
Block a user