diff options
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | po/en_US.po | 280 | ||||
| -rw-r--r-- | po/systems.tranquil.Map.pot | 270 | ||||
| -rw-r--r-- | src/preferences/pages/editor.rs | 214 |
4 files changed, 405 insertions, 361 deletions
@@ -10,7 +10,7 @@ authors = ["Rubén Beltrán del Río <wmap@r.bdr.sh>"] [dependencies] cairo-rs = "0.21.5" dirs = "5.0" -gettext-rs = "0.7" +gettext-rs = { version = "0.7", features = ["gettext-system"] } relm4 = "0.10.0" relm4-components = "0.10.0" relm4-icons = "0.10.0" diff --git a/po/en_US.po b/po/en_US.po index daa9615..718b1d7 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-17 02:37+0100\n" -"PO-Revision-Date: 2026-01-17 02:37+0100\n" +"POT-Creation-Date: 2026-01-18 00:13+0100\n" +"PO-Revision-Date: 2026-01-18 00:17+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" @@ -71,7 +71,7 @@ msgstr "Export Map as Image" msgid "dialog.action.export" msgstr "Export" -#: src/handlers/export.rs:41 +#: src/handlers/export.rs:45 msgid "error.file.export" msgstr "Could not export image. Please make sure the destination is writable." @@ -83,82 +83,79 @@ msgstr "Could not open file. Please make sure the file is readable." msgid "errors.file.save" msgstr "Could not save file. Please make sure the destination is writable." -#: src/main.rs:246 +#: src/main.rs:251 msgid "document.untitled" msgstr "Untitled" -#: src/main.rs:386 src/main.rs:579 -msgid "command.view.use_vertical_layout" -msgstr "Use Vertical Layout" - -#: src/main.rs:387 -msgid "command.view.layout.use_horizontal_layout" -msgstr "Use Horizontal Layout" - -#: src/main.rs:400 src/main.rs:575 -msgid "command.file.export" -msgstr "Export as Image" - -#: src/main.rs:458 src/main.rs:586 -msgid "command.view.zoom_out" -msgstr "Zoom Out" - -#: src/main.rs:481 src/main.rs:585 -msgid "command.view.zoom_in" -msgstr "Zoom In" - -#: src/main.rs:569 +#: src/main.rs:446 msgid "command.file.new" msgstr "New Map" -#: src/main.rs:570 +#: src/main.rs:448 msgid "command.file.new_from_template" msgstr "New from Template" -#: src/main.rs:571 +#: src/main.rs:451 msgid "command.file.open" msgstr "Open..." -#: src/main.rs:572 +#: src/main.rs:452 msgid "command.file.save" msgstr "Save" -#: src/main.rs:573 +#: src/main.rs:453 msgid "command.file.save_as" msgstr "Save As..." -#: src/main.rs:574 +#: src/main.rs:454 msgid "command.file.close" msgstr "Close" -#: src/main.rs:590 +#: src/main.rs:456 src/main.rs:520 +msgid "command.file.export" +msgstr "Export as Image" + +#: src/main.rs:462 src/main.rs:506 +msgid "command.view.use_vertical_layout" +msgstr "Use Vertical Layout" + +#: src/main.rs:468 src/main.rs:601 +msgid "command.view.zoom_in" +msgstr "Zoom In" + +#: src/main.rs:469 src/main.rs:578 +msgid "command.view.zoom_out" +msgstr "Zoom Out" + +#: src/main.rs:474 msgid "command.application.preferences" msgstr "Preferences" -#. Font Size section -#: src/preferences/pages/editor.rs:45 +#: src/main.rs:507 +msgid "command.view.layout.use_horizontal_layout" +msgstr "Use Horizontal Layout" + +#: src/preferences/pages/editor.rs:73 msgid "preferences.editor.font_size.title" msgstr "Font Size" -#: src/preferences/pages/editor.rs:60 -msgid "preferences.editor.font_size.unit" -msgstr "pt" +#: src/preferences/pages/editor.rs:87 +msgid "preferences.editor.default_font_size" +msgstr "Default" -#. Editor Style section -#: src/preferences/pages/editor.rs:64 +#: src/preferences/pages/editor.rs:105 msgid "preferences.editor.editor_style.title" msgstr "Editor Style" -#. Soft Wrap Lines -#: src/preferences/pages/editor.rs:71 +#: src/preferences/pages/editor.rs:112 msgid "preferences.editor.editor_style.soft_wrap_lines" msgstr "Soft wrap lines" -#: src/preferences/pages/editor.rs:84 +#: src/preferences/pages/editor.rs:118 msgid "preferences.editor.editor_style.use_custom_font" msgstr "Use custom font" -#: src/preferences/pages/editor.rs:90 +#: src/preferences/pages/editor.rs:142 msgid "preferences.editor.font" msgstr "Font" @@ -201,42 +198,39 @@ msgstr "Export Preferences" msgid "dialog.import_preferences.title" msgstr "Import Preferences" -#. Map Style section -#: src/preferences/pages/map.rs:46 +#: src/preferences/pages/map.rs:65 msgid "preferences.map.map_style.title" msgstr "Map Style" -#: src/preferences/pages/map.rs:53 +#: src/preferences/pages/map.rs:72 msgid "preferences.map.map_style.show_background" msgstr "Show map background" -#: src/preferences/pages/map.rs:66 +#: src/preferences/pages/map.rs:87 msgid "preferences.map.map_style.use_smart_label_positioning" msgstr "Use smart label positioning" -#. Use Custom Font -#: src/preferences/pages/map.rs:80 +#: src/preferences/pages/map.rs:102 msgid "preferences.map.map_style.use_custom_font" msgstr "Use custom font" -#: src/preferences/pages/map.rs:86 +#: src/preferences/pages/map.rs:110 msgid "preferences.map.font" msgstr "Font" -#. Export section -#: src/preferences/pages/map.rs:119 +#: src/preferences/pages/map.rs:155 msgid "preferences.map.export.title" msgstr "Export" -#: src/preferences/pages/map.rs:126 +#: src/preferences/pages/map.rs:163 msgid "preferences.map.export.default_format" msgstr "Default export format" -#: src/preferences/pages/map.rs:128 +#: src/preferences/pages/map.rs:167 msgid "export_formats.png" msgstr "PNG (Raster)" -#: src/preferences/pages/map.rs:128 +#: src/preferences/pages/map.rs:167 msgid "export_formats.svg" msgstr "SVG (Vector)" @@ -301,7 +295,7 @@ msgstr "Template Content" msgid "preferences.templates.help.default" msgstr "This is the default template." -#: src/preferences/pages/templates.rs:254 +#: src/preferences/pages/templates.rs:255 msgid "preferences.templates.help.set_as_default" msgstr "Set as default template." @@ -417,372 +411,372 @@ msgstr "Cynefin" msgid "stages.evolution_stage.name" msgstr "Evolution Stage" -#: src/stages.rs:85 +#: src/stages.rs:91 msgid "stage.activities.i" msgstr "Genesis" -#: src/stages.rs:86 +#: src/stages.rs:92 msgid "stage.practice.i" msgstr "Novel" -#: src/stages.rs:87 +#: src/stages.rs:93 msgid "stage.data.i" msgstr "Unmodelled" -#: src/stages.rs:88 +#: src/stages.rs:94 msgid "stages.knowledge.i" msgstr "Concept" -#: src/stages.rs:89 +#: src/stages.rs:95 msgid "stages.ubiquity.i" msgstr "Rare" -#: src/stages.rs:90 +#: src/stages.rs:96 msgid "stages.certainty.i" msgstr "Poorly Understood / exploring the unknown" -#: src/stages.rs:91 +#: src/stages.rs:97 msgid "stages.publication_types.i" msgstr "" "Describe the wonder of the thing / the discovery of some marvel / a new " "land / an unknown frontier" -#: src/stages.rs:92 +#: src/stages.rs:98 msgid "stages.market.i" msgstr "Undefined Market" -#: src/stages.rs:93 +#: src/stages.rs:99 msgid "stages.knowledge_management.i" msgstr "Uncertain" -#: src/stages.rs:94 +#: src/stages.rs:100 msgid "stages.market_perception.i" msgstr "Chaotic (non-linear) / domain of the \"crazy\"" -#: src/stages.rs:95 +#: src/stages.rs:101 msgid "stages.user_perception.i" msgstr "Different / confusing / exciting / surprising / dangerous" -#: src/stages.rs:96 +#: src/stages.rs:102 msgid "stages.perception_in_industry.i" msgstr "Future source of competitive advantage / unpredictable / unknown" -#: src/stages.rs:97 +#: src/stages.rs:103 msgid "stages.focus_of_value.i" msgstr "High future worth but immediate investment" -#: src/stages.rs:98 +#: src/stages.rs:104 msgid "stages.understanding.i" msgstr "Poorly Understood / unpredictable" -#: src/stages.rs:99 +#: src/stages.rs:105 msgid "stages.comparison.i" msgstr "Constantly changing / a differential / unstable" -#: src/stages.rs:100 +#: src/stages.rs:106 msgid "stages.failure.i" msgstr "High / tolerated / assumed to be wrong" -#: src/stages.rs:101 +#: src/stages.rs:107 msgid "stages.market_action.i" msgstr "Gambling / driven by gut" -#: src/stages.rs:102 +#: src/stages.rs:108 msgid "stages.efficiency.i" msgstr "Reducing the cost of change (experimentation)" -#: src/stages.rs:103 +#: src/stages.rs:109 msgid "stages.decision_drivers.i" msgstr "Heritage / culture" -#: src/stages.rs:104 +#: src/stages.rs:110 msgid "stages.behavior.i" msgstr "Uncertain when to use" -#: src/stages.rs:105 +#: src/stages.rs:111 msgid "stages.cynefin.i" msgstr "Chaotic" -#: src/stages.rs:106 +#: src/stages.rs:112 msgid "stages.evolution_stage.i" msgstr "Stage I" -#: src/stages.rs:112 +#: src/stages.rs:124 msgid "stage.activities.ii" msgstr "Custom" -#: src/stages.rs:113 +#: src/stages.rs:125 msgid "stage.practice.ii" msgstr "Emerging" -#: src/stages.rs:114 +#: src/stages.rs:126 msgid "stage.data.ii" msgstr "Divergent" -#: src/stages.rs:115 +#: src/stages.rs:127 msgid "stages.knowledge.ii" msgstr "Hypothesis" -#: src/stages.rs:116 +#: src/stages.rs:128 msgid "stages.ubiquity.ii" msgstr "Slowly Increasing" -#: src/stages.rs:117 +#: src/stages.rs:129 msgid "stages.certainty.ii" msgstr "Rapid Increase In Learning / discovery becomes refining" -#: src/stages.rs:118 +#: src/stages.rs:130 msgid "stages.publication_types.ii" msgstr "" "Focused on build / construct / awareness and learning / many models of " "explanation / no accepted forms / a wild west" -#: src/stages.rs:119 +#: src/stages.rs:131 msgid "stages.market.ii" msgstr "" "Forming Market / an array of competing forms and models of understanding" -#: src/stages.rs:120 +#: src/stages.rs:132 msgid "stages.knowledge_management.ii" msgstr "Learning on use / focused on testing prediction" -#: src/stages.rs:121 +#: src/stages.rs:133 msgid "stages.market_perception.ii" msgstr "Domain of \"experts\"" -#: src/stages.rs:122 +#: src/stages.rs:134 msgid "stages.user_perception.ii" msgstr "Leading edge / emerging / unceirtanty over results" -#: src/stages.rs:123 +#: src/stages.rs:135 msgid "stages.perception_in_industry.ii" msgstr "" "Seen as a scompetitive advantage / a differential / ROI / case examples" -#: src/stages.rs:124 +#: src/stages.rs:136 msgid "stages.focus_of_value.ii" msgstr "Seeking ways to profit and a ROI / seeking confirmation of value" -#: src/stages.rs:125 +#: src/stages.rs:137 msgid "stages.understanding.ii" msgstr "Increasing understanding / development of measures" -#: src/stages.rs:126 +#: src/stages.rs:138 msgid "stages.comparison.ii" msgstr "Learning from others / testing the water / some evidential support" -#: src/stages.rs:127 +#: src/stages.rs:139 msgid "stages.failure.ii" msgstr "Moderate / unsurprising if wrong but disappointed" -#: src/stages.rs:128 +#: src/stages.rs:140 msgid "stages.market_action.ii" msgstr "Exploring a \"found\" value" -#: src/stages.rs:129 +#: src/stages.rs:141 msgid "stages.efficiency.ii" msgstr "Reducing cost of waste (Learning)" -#: src/stages.rs:130 +#: src/stages.rs:142 msgid "stages.decision_drivers.ii" msgstr "Analyses & synthesis" -#: src/stages.rs:131 +#: src/stages.rs:143 msgid "stages.behavior.ii" msgstr "Learning when to use" -#: src/stages.rs:132 +#: src/stages.rs:144 msgid "stages.cynefin.ii" msgstr "Complex" -#: src/stages.rs:133 +#: src/stages.rs:145 msgid "stages.evolution_stage.ii" msgstr "Stage II" -#: src/stages.rs:139 +#: src/stages.rs:157 msgid "stage.activities.iii" msgstr "Product (+rental)" -#: src/stages.rs:140 +#: src/stages.rs:158 msgid "stage.practice.iii" msgstr "Good" -#: src/stages.rs:141 +#: src/stages.rs:159 msgid "stage.data.iii" msgstr "Convergent" -#: src/stages.rs:142 +#: src/stages.rs:160 msgid "stages.knowledge.iii" msgstr "Theory" -#: src/stages.rs:143 +#: src/stages.rs:161 msgid "stages.ubiquity.iii" msgstr "Rapidly Increasing" -#: src/stages.rs:144 +#: src/stages.rs:162 msgid "stages.certainty.iii" msgstr "Rapid increase in use / increasing fit for purpose" -#: src/stages.rs:145 +#: src/stages.rs:163 msgid "stages.publication_types.iii" msgstr "" "Maintenance / operations / installation / comparison between competing " "forms / feature analysis" -#: src/stages.rs:146 +#: src/stages.rs:164 msgid "stages.market.iii" msgstr "" "Growing Market / consolidation to a few competing but more accepted forms" -#: src/stages.rs:147 +#: src/stages.rs:165 msgid "stages.knowledge_management.iii" msgstr "Learning on operation / using prediction / verification" -#: src/stages.rs:148 +#: src/stages.rs:166 msgid "stages.market_perception.iii" msgstr "Increasing expectation of use / domain of \"professionals\"" -#: src/stages.rs:149 +#: src/stages.rs:167 msgid "stages.user_perception.iii" msgstr "" "Increasingly common / disappointed if not used or available / feeling left " "behind" -#: src/stages.rs:150 +#: src/stages.rs:168 msgid "stages.perception_in_industry.iii" msgstr "" "Advantage through implementation / features / this model is better than that" -#: src/stages.rs:151 +#: src/stages.rs:169 msgid "stages.focus_of_value.iii" msgstr "" "High profitability per unit / a valuable model / a feeling of " "understanding / focus on exploitation" -#: src/stages.rs:152 +#: src/stages.rs:170 msgid "stages.understanding.iii" msgstr "Increasing education / constant refinement of needs / measures" -#: src/stages.rs:153 +#: src/stages.rs:171 msgid "stages.comparison.iii" msgstr "Competing models / feature difference / evidential support" -#: src/stages.rs:154 +#: src/stages.rs:172 msgid "stages.failure.iii" msgstr "" "Not tolerated / focus on constant improvement / assumed to be in the right " "direction / resistance to changing the model" -#: src/stages.rs:155 +#: src/stages.rs:173 msgid "stages.market_action.iii" msgstr "Market analysis / listening to customers" -#: src/stages.rs:156 +#: src/stages.rs:174 msgid "stages.efficiency.iii" msgstr "Reducing cost of waste (Learning)" -#: src/stages.rs:157 +#: src/stages.rs:175 msgid "stages.decision_drivers.iii" msgstr "Analyses & synthesis" -#: src/stages.rs:158 +#: src/stages.rs:176 msgid "stages.behavior.iii" msgstr "Learning through use" -#: src/stages.rs:159 +#: src/stages.rs:177 msgid "stages.cynefin.iii" msgstr "Complicated" -#: src/stages.rs:160 +#: src/stages.rs:178 msgid "stages.evolution_stage.iii" msgstr "Stage III" -#: src/stages.rs:166 +#: src/stages.rs:190 msgid "stage.activities.iv" msgstr "Commodity (+utility)" -#: src/stages.rs:167 +#: src/stages.rs:191 msgid "stage.practice.iv" msgstr "Best" -#: src/stages.rs:168 +#: src/stages.rs:192 msgid "stage.data.iv" msgstr "Modelled" -#: src/stages.rs:169 +#: src/stages.rs:193 msgid "stages.knowledge.iv" msgstr "Accepted" -#: src/stages.rs:170 +#: src/stages.rs:194 msgid "stages.ubiquity.iv" msgstr "Widespread in the applicable market / ecosystem" -#: src/stages.rs:171 +#: src/stages.rs:195 msgid "stages.certainty.iv" msgstr "Commonly understood (in terms of use)" -#: src/stages.rs:172 +#: src/stages.rs:196 msgid "stages.publication_types.iv" msgstr "Focused on use / increasingly an accepted, almost invisible component" -#: src/stages.rs:173 +#: src/stages.rs:197 msgid "stages.market.iv" msgstr "Mature Market / stabilised to an accepted form" -#: src/stages.rs:174 +#: src/stages.rs:198 msgid "stages.knowledge_management.iv" msgstr "Known / accepted" -#: src/stages.rs:175 +#: src/stages.rs:199 msgid "stages.market_perception.iv" msgstr "Ordered (appearance of being linear) / trivial / formula to be applied" -#: src/stages.rs:176 +#: src/stages.rs:200 msgid "stages.user_perception.iv" msgstr "Standard / expected / feeling of shock if not used" -#: src/stages.rs:177 +#: src/stages.rs:201 msgid "stages.perception_in_industry.iv" msgstr "Cost of doing business / accepted / specific defined models" -#: src/stages.rs:178 +#: src/stages.rs:202 msgid "stages.focus_of_value.iv" msgstr "" "High volume / reducing margin / important but invisible / an essential " "component of something more complex" -#: src/stages.rs:179 +#: src/stages.rs:203 msgid "stages.understanding.iv" msgstr "Believed to be well defined / stable / measurable" -#: src/stages.rs:180 +#: src/stages.rs:204 msgid "stages.comparison.iv" msgstr "Essential / any advantage is operational / accepted norm" -#: src/stages.rs:181 +#: src/stages.rs:205 msgid "stages.failure.iv" msgstr "Surprised by failure / focus on operational efficiency" -#: src/stages.rs:182 +#: src/stages.rs:206 msgid "stages.market_action.iv" msgstr "Metric driven / build what is needed" -#: src/stages.rs:183 +#: src/stages.rs:207 msgid "stages.efficiency.iv" msgstr "Reducing cost of deviation (Volume)" -#: src/stages.rs:184 +#: src/stages.rs:208 msgid "stages.decision_drivers.iv" msgstr "Previous Experience" -#: src/stages.rs:185 +#: src/stages.rs:209 msgid "stages.behavior.iv" msgstr "Known / common usage" -#: src/stages.rs:186 +#: src/stages.rs:210 msgid "stages.cynefin.iv" msgstr "Clear" -#: src/stages.rs:187 +#: src/stages.rs:211 msgid "stages.evolution_stage.iv" msgstr "Stage IV" diff --git a/po/systems.tranquil.Map.pot b/po/systems.tranquil.Map.pot index bac0955..f4a20c8 100644 --- a/po/systems.tranquil.Map.pot +++ b/po/systems.tranquil.Map.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-17 02:37+0100\n" +"POT-Creation-Date: 2026-01-18 00:13+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -70,7 +70,7 @@ msgstr "" msgid "dialog.action.export" msgstr "" -#: src/handlers/export.rs:41 +#: src/handlers/export.rs:45 msgid "error.file.export" msgstr "" @@ -82,82 +82,79 @@ msgstr "" msgid "errors.file.save" msgstr "" -#: src/main.rs:246 +#: src/main.rs:251 msgid "document.untitled" msgstr "" -#: src/main.rs:386 src/main.rs:579 -msgid "command.view.use_vertical_layout" +#: src/main.rs:446 +msgid "command.file.new" msgstr "" -#: src/main.rs:387 -msgid "command.view.layout.use_horizontal_layout" +#: src/main.rs:448 +msgid "command.file.new_from_template" msgstr "" -#: src/main.rs:400 src/main.rs:575 -msgid "command.file.export" +#: src/main.rs:451 +msgid "command.file.open" msgstr "" -#: src/main.rs:458 src/main.rs:586 -msgid "command.view.zoom_out" +#: src/main.rs:452 +msgid "command.file.save" msgstr "" -#: src/main.rs:481 src/main.rs:585 -msgid "command.view.zoom_in" +#: src/main.rs:453 +msgid "command.file.save_as" msgstr "" -#: src/main.rs:569 -msgid "command.file.new" +#: src/main.rs:454 +msgid "command.file.close" msgstr "" -#: src/main.rs:570 -msgid "command.file.new_from_template" +#: src/main.rs:456 src/main.rs:520 +msgid "command.file.export" msgstr "" -#: src/main.rs:571 -msgid "command.file.open" +#: src/main.rs:462 src/main.rs:506 +msgid "command.view.use_vertical_layout" msgstr "" -#: src/main.rs:572 -msgid "command.file.save" +#: src/main.rs:468 src/main.rs:601 +msgid "command.view.zoom_in" msgstr "" -#: src/main.rs:573 -msgid "command.file.save_as" +#: src/main.rs:469 src/main.rs:578 +msgid "command.view.zoom_out" msgstr "" -#: src/main.rs:574 -msgid "command.file.close" +#: src/main.rs:474 +msgid "command.application.preferences" msgstr "" -#: src/main.rs:590 -msgid "command.application.preferences" +#: src/main.rs:507 +msgid "command.view.layout.use_horizontal_layout" msgstr "" -#. Font Size section -#: src/preferences/pages/editor.rs:45 +#: src/preferences/pages/editor.rs:73 msgid "preferences.editor.font_size.title" msgstr "" -#: src/preferences/pages/editor.rs:60 -msgid "preferences.editor.font_size.unit" +#: src/preferences/pages/editor.rs:87 +msgid "preferences.editor.default_font_size" msgstr "" -#. Editor Style section -#: src/preferences/pages/editor.rs:64 +#: src/preferences/pages/editor.rs:105 msgid "preferences.editor.editor_style.title" msgstr "" -#. Soft Wrap Lines -#: src/preferences/pages/editor.rs:71 +#: src/preferences/pages/editor.rs:112 msgid "preferences.editor.editor_style.soft_wrap_lines" msgstr "" -#: src/preferences/pages/editor.rs:84 +#: src/preferences/pages/editor.rs:118 msgid "preferences.editor.editor_style.use_custom_font" msgstr "" -#: src/preferences/pages/editor.rs:90 +#: src/preferences/pages/editor.rs:142 msgid "preferences.editor.font" msgstr "" @@ -198,42 +195,39 @@ msgstr "" msgid "dialog.import_preferences.title" msgstr "" -#. Map Style section -#: src/preferences/pages/map.rs:46 +#: src/preferences/pages/map.rs:65 msgid "preferences.map.map_style.title" msgstr "" -#: src/preferences/pages/map.rs:53 +#: src/preferences/pages/map.rs:72 msgid "preferences.map.map_style.show_background" msgstr "" -#: src/preferences/pages/map.rs:66 +#: src/preferences/pages/map.rs:87 msgid "preferences.map.map_style.use_smart_label_positioning" msgstr "" -#. Use Custom Font -#: src/preferences/pages/map.rs:80 +#: src/preferences/pages/map.rs:102 msgid "preferences.map.map_style.use_custom_font" msgstr "" -#: src/preferences/pages/map.rs:86 +#: src/preferences/pages/map.rs:110 msgid "preferences.map.font" msgstr "" -#. Export section -#: src/preferences/pages/map.rs:119 +#: src/preferences/pages/map.rs:155 msgid "preferences.map.export.title" msgstr "" -#: src/preferences/pages/map.rs:126 +#: src/preferences/pages/map.rs:163 msgid "preferences.map.export.default_format" msgstr "" -#: src/preferences/pages/map.rs:128 +#: src/preferences/pages/map.rs:167 msgid "export_formats.png" msgstr "" -#: src/preferences/pages/map.rs:128 +#: src/preferences/pages/map.rs:167 msgid "export_formats.svg" msgstr "" @@ -298,7 +292,7 @@ msgstr "" msgid "preferences.templates.help.default" msgstr "" -#: src/preferences/pages/templates.rs:254 +#: src/preferences/pages/templates.rs:255 msgid "preferences.templates.help.set_as_default" msgstr "" @@ -414,354 +408,354 @@ msgstr "" msgid "stages.evolution_stage.name" msgstr "" -#: src/stages.rs:85 +#: src/stages.rs:91 msgid "stage.activities.i" msgstr "" -#: src/stages.rs:86 +#: src/stages.rs:92 msgid "stage.practice.i" msgstr "" -#: src/stages.rs:87 +#: src/stages.rs:93 msgid "stage.data.i" msgstr "" -#: src/stages.rs:88 +#: src/stages.rs:94 msgid "stages.knowledge.i" msgstr "" -#: src/stages.rs:89 +#: src/stages.rs:95 msgid "stages.ubiquity.i" msgstr "" -#: src/stages.rs:90 +#: src/stages.rs:96 msgid "stages.certainty.i" msgstr "" -#: src/stages.rs:91 +#: src/stages.rs:97 msgid "stages.publication_types.i" msgstr "" -#: src/stages.rs:92 +#: src/stages.rs:98 msgid "stages.market.i" msgstr "" -#: src/stages.rs:93 +#: src/stages.rs:99 msgid "stages.knowledge_management.i" msgstr "" -#: src/stages.rs:94 +#: src/stages.rs:100 msgid "stages.market_perception.i" msgstr "" -#: src/stages.rs:95 +#: src/stages.rs:101 msgid "stages.user_perception.i" msgstr "" -#: src/stages.rs:96 +#: src/stages.rs:102 msgid "stages.perception_in_industry.i" msgstr "" -#: src/stages.rs:97 +#: src/stages.rs:103 msgid "stages.focus_of_value.i" msgstr "" -#: src/stages.rs:98 +#: src/stages.rs:104 msgid "stages.understanding.i" msgstr "" -#: src/stages.rs:99 +#: src/stages.rs:105 msgid "stages.comparison.i" msgstr "" -#: src/stages.rs:100 +#: src/stages.rs:106 msgid "stages.failure.i" msgstr "" -#: src/stages.rs:101 +#: src/stages.rs:107 msgid "stages.market_action.i" msgstr "" -#: src/stages.rs:102 +#: src/stages.rs:108 msgid "stages.efficiency.i" msgstr "" -#: src/stages.rs:103 +#: src/stages.rs:109 msgid "stages.decision_drivers.i" msgstr "" -#: src/stages.rs:104 +#: src/stages.rs:110 msgid "stages.behavior.i" msgstr "" -#: src/stages.rs:105 +#: src/stages.rs:111 msgid "stages.cynefin.i" msgstr "" -#: src/stages.rs:106 +#: src/stages.rs:112 msgid "stages.evolution_stage.i" msgstr "" -#: src/stages.rs:112 +#: src/stages.rs:124 msgid "stage.activities.ii" msgstr "" -#: src/stages.rs:113 +#: src/stages.rs:125 msgid "stage.practice.ii" msgstr "" -#: src/stages.rs:114 +#: src/stages.rs:126 msgid "stage.data.ii" msgstr "" -#: src/stages.rs:115 +#: src/stages.rs:127 msgid "stages.knowledge.ii" msgstr "" -#: src/stages.rs:116 +#: src/stages.rs:128 msgid "stages.ubiquity.ii" msgstr "" -#: src/stages.rs:117 +#: src/stages.rs:129 msgid "stages.certainty.ii" msgstr "" -#: src/stages.rs:118 +#: src/stages.rs:130 msgid "stages.publication_types.ii" msgstr "" -#: src/stages.rs:119 +#: src/stages.rs:131 msgid "stages.market.ii" msgstr "" -#: src/stages.rs:120 +#: src/stages.rs:132 msgid "stages.knowledge_management.ii" msgstr "" -#: src/stages.rs:121 +#: src/stages.rs:133 msgid "stages.market_perception.ii" msgstr "" -#: src/stages.rs:122 +#: src/stages.rs:134 msgid "stages.user_perception.ii" msgstr "" -#: src/stages.rs:123 +#: src/stages.rs:135 msgid "stages.perception_in_industry.ii" msgstr "" -#: src/stages.rs:124 +#: src/stages.rs:136 msgid "stages.focus_of_value.ii" msgstr "" -#: src/stages.rs:125 +#: src/stages.rs:137 msgid "stages.understanding.ii" msgstr "" -#: src/stages.rs:126 +#: src/stages.rs:138 msgid "stages.comparison.ii" msgstr "" -#: src/stages.rs:127 +#: src/stages.rs:139 msgid "stages.failure.ii" msgstr "" -#: src/stages.rs:128 +#: src/stages.rs:140 msgid "stages.market_action.ii" msgstr "" -#: src/stages.rs:129 +#: src/stages.rs:141 msgid "stages.efficiency.ii" msgstr "" -#: src/stages.rs:130 +#: src/stages.rs:142 msgid "stages.decision_drivers.ii" msgstr "" -#: src/stages.rs:131 +#: src/stages.rs:143 msgid "stages.behavior.ii" msgstr "" -#: src/stages.rs:132 +#: src/stages.rs:144 msgid "stages.cynefin.ii" msgstr "" -#: src/stages.rs:133 +#: src/stages.rs:145 msgid "stages.evolution_stage.ii" msgstr "" -#: src/stages.rs:139 +#: src/stages.rs:157 msgid "stage.activities.iii" msgstr "" -#: src/stages.rs:140 +#: src/stages.rs:158 msgid "stage.practice.iii" msgstr "" -#: src/stages.rs:141 +#: src/stages.rs:159 msgid "stage.data.iii" msgstr "" -#: src/stages.rs:142 +#: src/stages.rs:160 msgid "stages.knowledge.iii" msgstr "" -#: src/stages.rs:143 +#: src/stages.rs:161 msgid "stages.ubiquity.iii" msgstr "" -#: src/stages.rs:144 +#: src/stages.rs:162 msgid "stages.certainty.iii" msgstr "" -#: src/stages.rs:145 +#: src/stages.rs:163 msgid "stages.publication_types.iii" msgstr "" -#: src/stages.rs:146 +#: src/stages.rs:164 msgid "stages.market.iii" msgstr "" -#: src/stages.rs:147 +#: src/stages.rs:165 msgid "stages.knowledge_management.iii" msgstr "" -#: src/stages.rs:148 +#: src/stages.rs:166 msgid "stages.market_perception.iii" msgstr "" -#: src/stages.rs:149 +#: src/stages.rs:167 msgid "stages.user_perception.iii" msgstr "" -#: src/stages.rs:150 +#: src/stages.rs:168 msgid "stages.perception_in_industry.iii" msgstr "" -#: src/stages.rs:151 +#: src/stages.rs:169 msgid "stages.focus_of_value.iii" msgstr "" -#: src/stages.rs:152 +#: src/stages.rs:170 msgid "stages.understanding.iii" msgstr "" -#: src/stages.rs:153 +#: src/stages.rs:171 msgid "stages.comparison.iii" msgstr "" -#: src/stages.rs:154 +#: src/stages.rs:172 msgid "stages.failure.iii" msgstr "" -#: src/stages.rs:155 +#: src/stages.rs:173 msgid "stages.market_action.iii" msgstr "" -#: src/stages.rs:156 +#: src/stages.rs:174 msgid "stages.efficiency.iii" msgstr "" -#: src/stages.rs:157 +#: src/stages.rs:175 msgid "stages.decision_drivers.iii" msgstr "" -#: src/stages.rs:158 +#: src/stages.rs:176 msgid "stages.behavior.iii" msgstr "" -#: src/stages.rs:159 +#: src/stages.rs:177 msgid "stages.cynefin.iii" msgstr "" -#: src/stages.rs:160 +#: src/stages.rs:178 msgid "stages.evolution_stage.iii" msgstr "" -#: src/stages.rs:166 +#: src/stages.rs:190 msgid "stage.activities.iv" msgstr "" -#: src/stages.rs:167 +#: src/stages.rs:191 msgid "stage.practice.iv" msgstr "" -#: src/stages.rs:168 +#: src/stages.rs:192 msgid "stage.data.iv" msgstr "" -#: src/stages.rs:169 +#: src/stages.rs:193 msgid "stages.knowledge.iv" msgstr "" -#: src/stages.rs:170 +#: src/stages.rs:194 msgid "stages.ubiquity.iv" msgstr "" -#: src/stages.rs:171 +#: src/stages.rs:195 msgid "stages.certainty.iv" msgstr "" -#: src/stages.rs:172 +#: src/stages.rs:196 msgid "stages.publication_types.iv" msgstr "" -#: src/stages.rs:173 +#: src/stages.rs:197 msgid "stages.market.iv" msgstr "" -#: src/stages.rs:174 +#: src/stages.rs:198 msgid "stages.knowledge_management.iv" msgstr "" -#: src/stages.rs:175 +#: src/stages.rs:199 msgid "stages.market_perception.iv" msgstr "" -#: src/stages.rs:176 +#: src/stages.rs:200 msgid "stages.user_perception.iv" msgstr "" -#: src/stages.rs:177 +#: src/stages.rs:201 msgid "stages.perception_in_industry.iv" msgstr "" -#: src/stages.rs:178 +#: src/stages.rs:202 msgid "stages.focus_of_value.iv" msgstr "" -#: src/stages.rs:179 +#: src/stages.rs:203 msgid "stages.understanding.iv" msgstr "" -#: src/stages.rs:180 +#: src/stages.rs:204 msgid "stages.comparison.iv" msgstr "" -#: src/stages.rs:181 +#: src/stages.rs:205 msgid "stages.failure.iv" msgstr "" -#: src/stages.rs:182 +#: src/stages.rs:206 msgid "stages.market_action.iv" msgstr "" -#: src/stages.rs:183 +#: src/stages.rs:207 msgid "stages.efficiency.iv" msgstr "" -#: src/stages.rs:184 +#: src/stages.rs:208 msgid "stages.decision_drivers.iv" msgstr "" -#: src/stages.rs:185 +#: src/stages.rs:209 msgid "stages.behavior.iv" msgstr "" -#: src/stages.rs:186 +#: src/stages.rs:210 msgid "stages.cynefin.iv" msgstr "" -#: src/stages.rs:187 +#: src/stages.rs:211 msgid "stages.evolution_stage.iv" msgstr "" diff --git a/src/preferences/pages/editor.rs b/src/preferences/pages/editor.rs index 65b7d80..27b94da 100644 --- a/src/preferences/pages/editor.rs +++ b/src/preferences/pages/editor.rs @@ -24,9 +24,11 @@ use crate::ui_helpers::create_switch_row; use super::super::models::UserPreferences; use super::super::window::PreferencesInput; +const DEFAULT_FONT_SIZE: f64 = 14.0; + pub struct EditorPage { container: gtk::Box, - font_size_spin: gtk::SpinButton, + font_size_scale: gtk::Scale, soft_wrap_switch: gtk::Switch, custom_font_switch: gtk::Switch, font_button: gtk::FontButton, @@ -41,106 +43,160 @@ impl EditorPage { container.set_margin_end(20); container.set_valign(gtk::Align::Start); - // Font Size section - let font_size_label = gtk::Label::new(Some(&tr!("preferences.editor.font_size.title"))); - font_size_label.add_css_class("heading"); - font_size_label.set_halign(gtk::Align::Start); - container.append(&font_size_label); + let (font_size_box, font_size_scale) = Self::create_font_size_section(preferences); + container.append(&font_size_box); + + let (soft_wrap_switch, custom_font_switch) = + Self::create_style_section(&container, preferences); + + let font_button = Self::create_font_button(preferences); + container.append(&Self::create_font_row(&font_button)); + + Self::connect_signals( + sender, + &font_size_scale, + &soft_wrap_switch, + &custom_font_switch, + &font_button, + ); - let font_size_box = gtk::Box::new(gtk::Orientation::Horizontal, 10); - let font_size_spin = gtk::SpinButton::with_range(7.0, 21.0, 1.0); - font_size_spin.set_value(preferences.editor_font_size); - { - let sender = sender.clone(); - font_size_spin.connect_value_changed(move |spin| { - sender.emit(PreferencesInput::SetEditorFontSize(spin.value())); - }); + Self { + container, + font_size_scale, + soft_wrap_switch, + custom_font_switch, + font_button, } - font_size_box.append(&font_size_spin); - font_size_box.append(>k::Label::new(Some(&tr!( - "preferences.editor.font_size.unit" - )))); - container.append(&font_size_box); + } + + fn create_font_size_section(preferences: &UserPreferences) -> (gtk::Box, gtk::Scale) { + let label = gtk::Label::new(Some(&tr!("preferences.editor.font_size.title"))); + label.add_css_class("heading"); + label.set_halign(gtk::Align::Start); + + let scale = gtk::Scale::with_range(gtk::Orientation::Horizontal, 7.0, 21.0, 1.0); + scale.set_value(preferences.editor_font_size); + scale.set_draw_value(true); + scale.set_hexpand(true); + #[allow(clippy::cast_possible_truncation)] + scale.set_format_value_func(|_, value| { + #[allow(clippy::float_cmp)] + if value == DEFAULT_FONT_SIZE { + format!( + "{} ({})", + value as i32, + tr!("preferences.editor.default_font_size") + ) + } else { + format!("{}", value as i32) + } + }); + + let vbox = gtk::Box::new(gtk::Orientation::Vertical, 10); + vbox.append(&label); + vbox.append(&scale); + + (vbox, scale) + } - // Editor Style section - let style_label = gtk::Label::new(Some(&tr!("preferences.editor.editor_style.title"))); - style_label.add_css_class("heading"); - style_label.set_halign(gtk::Align::Start); - style_label.set_margin_top(10); - container.append(&style_label); + fn create_style_section( + container: >k::Box, + preferences: &UserPreferences, + ) -> (gtk::Switch, gtk::Switch) { + let label = gtk::Label::new(Some(&tr!("preferences.editor.editor_style.title"))); + label.add_css_class("heading"); + label.set_halign(gtk::Align::Start); + label.set_margin_top(10); + container.append(&label); - // Soft Wrap Lines let soft_wrap_row = create_switch_row( &tr!("preferences.editor.editor_style.soft_wrap_lines"), preferences.soft_wrap_lines, ); - let soft_wrap_switch = soft_wrap_row.1.clone(); - { - let sender = sender.clone(); - soft_wrap_switch.connect_state_set(move |_, state| { - sender.emit(PreferencesInput::SetSoftWrapLines(state)); - gtk::glib::Propagation::Proceed - }); - } container.append(&soft_wrap_row.0); - // Use Custom Font let custom_font_row = create_switch_row( &tr!("preferences.editor.editor_style.use_custom_font"), preferences.use_custom_editor_font, ); - let custom_font_switch = custom_font_row.1.clone(); container.append(&custom_font_row.0); - // Font selection - let font_row = gtk::Box::new(gtk::Orientation::Horizontal, 10); - font_row.append(>k::Label::new(Some(&tr!("preferences.editor.font")))); - - let font_button = gtk::FontButton::new(); - font_button.set_use_size(false); + (soft_wrap_row.1, custom_font_row.1) + } + fn create_font_button(preferences: &UserPreferences) -> gtk::FontButton { + let button = gtk::FontButton::new(); #[allow(clippy::cast_possible_truncation)] - font_button.set_font(&format!( + button.set_font(&format!( "{} {}", preferences.custom_editor_font_name, preferences.editor_font_size as i32 )); - font_button.set_sensitive(preferences.use_custom_editor_font); - font_button.set_hexpand(true); - font_button.set_use_font(true); - { - let sender = sender.clone(); - font_button.connect_font_set(move |button| { - if let Some(font) = button.font() { - // Extract font family from the font string - let font_desc = gtk::pango::FontDescription::from_string(&font); - if let Some(family) = font_desc.family() { - sender.emit(PreferencesInput::SetCustomEditorFontName( - family.to_string(), - )); - } + button.set_sensitive(preferences.use_custom_editor_font); + button.set_hexpand(true); + button.set_use_font(true); + button.set_use_size(false); + button + } + + fn create_font_row(font_button: >k::FontButton) -> gtk::Box { + let row = gtk::Box::new(gtk::Orientation::Horizontal, 10); + row.append(>k::Label::new(Some(&tr!("preferences.editor.font")))); + row.append(font_button); + row + } + + fn connect_signals( + sender: &Sender<PreferencesInput>, + font_size_scale: >k::Scale, + soft_wrap_switch: >k::Switch, + custom_font_switch: >k::Switch, + font_button: >k::FontButton, + ) { + let s = sender.clone(); + let fb = font_button.clone(); + font_size_scale.connect_value_changed(move |scale| { + s.emit(PreferencesInput::SetEditorFontSize(scale.value())); + Self::update_font_button_size(&fb, scale.value()); + }); + + let s = sender.clone(); + soft_wrap_switch.connect_state_set(move |_, state| { + s.emit(PreferencesInput::SetSoftWrapLines(state)); + gtk::glib::Propagation::Proceed + }); + + let s = sender.clone(); + let scale = font_size_scale.clone(); + font_button.connect_font_set(move |button| { + if let Some(font) = button.font() { + let font_desc = gtk::pango::FontDescription::from_string(&font); + if let Some(family) = font_desc.family() { + s.emit(PreferencesInput::SetCustomEditorFontName( + family.to_string(), + )); } - }); - } - font_row.append(&font_button); - container.append(&font_row); + let size = font_desc.size() / gtk::pango::SCALE; + if size > 0 { + scale.set_value(f64::from(size)); + } + } + }); - // Connect custom font switch to font button sensitivity - { - let font_button_clone = font_button.clone(); - let sender = sender.clone(); - custom_font_switch.connect_state_set(move |_, state| { - font_button_clone.set_sensitive(state); - sender.emit(PreferencesInput::SetUseCustomEditorFont(state)); - gtk::glib::Propagation::Proceed - }); - } + let s = sender.clone(); + let fb = font_button.clone(); + custom_font_switch.connect_state_set(move |_, state| { + fb.set_sensitive(state); + s.emit(PreferencesInput::SetUseCustomEditorFont(state)); + gtk::glib::Propagation::Proceed + }); + } - Self { - container, - font_size_spin, - soft_wrap_switch, - custom_font_switch, - font_button, + fn update_font_button_size(font_button: >k::FontButton, size: f64) { + if let Some(font) = font_button.font() { + let mut font_desc = gtk::pango::FontDescription::from_string(&font); + #[allow(clippy::cast_possible_truncation)] + font_desc.set_size(size as i32 * gtk::pango::SCALE); + font_button.set_font(&font_desc.to_string()); } } @@ -149,14 +205,14 @@ impl EditorPage { } pub fn sync_from(&self, preferences: &UserPreferences) { - self.font_size_spin.set_value(preferences.editor_font_size); + self.font_size_scale.set_value(preferences.editor_font_size); self.soft_wrap_switch .set_active(preferences.soft_wrap_lines); self.custom_font_switch .set_active(preferences.use_custom_editor_font); self.font_button .set_sensitive(preferences.use_custom_editor_font); - #[allow(clippy::cast_possible_truncation)] // Font size is always a small positive number + #[allow(clippy::cast_possible_truncation)] self.font_button.set_font(&format!( "{} {}", preferences.custom_editor_font_name, preferences.editor_font_size as i32 |