Commit fae1458f0e
Verified · cmc
Changed files (3)
Sources/OrgstarMobile/SettingsScreen.swift +29 −1 · view
| @@ -105,7 +105,7 @@ struct SettingsScreen: View { | |||
| 105 | } footer: { | 105 | } footer: { |
| 106 | if badges == false { Text("Turn on Badges in orgstar's notification settings.") } | 106 | if badges == false { Text("Turn on Badges in orgstar's notification settings.") } |
| 107 | } | 107 | } |
| 108 | Section("Appearance") { | 108 | Section { |
| 109 | let _ = model.settingsVersion | 109 | let _ = model.settingsVersion |
| 110 | NavigationLink { | 110 | NavigationLink { |
| 111 | ThemePickerScreen(model: model, appearance: .light) | 111 | ThemePickerScreen(model: model, appearance: .light) |
| @@ -122,6 +122,28 @@ struct SettingsScreen: View { | |||
| 122 | } label: { | 122 | } label: { |
| 123 | LabeledContent("App Icon", value: AppIcons.name(appIcon)) | 123 | LabeledContent("App Icon", value: AppIcons.name(appIcon)) |
| 124 | } | 124 | } |
| 125 | Picker("Body Font", selection: Binding { | ||
| 126 | UserDefaults.standard.string(forKey: "themeBodyFont") ?? "" | ||
| 127 | } set: { model.set("themeBodyFont", to: .string($0)) }) { | ||
| 128 | let body = UserDefaults.standard.string(forKey: "themeBodyFont") ?? "" | ||
| 129 | Text("Same as Font").tag("") | ||
| 130 | Text("System").tag("system") | ||
| 131 | ForEach(Self.proportionalFamilies, id: \.self) { Text($0).tag($0) } | ||
| 132 | if !["", "system"].contains(body), !Self.proportionalFamilies.contains(body) { Text(body).tag(body) } | ||
| 133 | } | ||
| 134 | .pickerStyle(.navigationLink) | ||
| 135 | Picker("Text Width", selection: Binding { | ||
| 136 | UserDefaults.standard.integer(forKey: "themeTextWidth") | ||
| 137 | } set: { model.set("themeTextWidth", to: .integer($0)) }) { | ||
| 138 | let width = UserDefaults.standard.integer(forKey: "themeTextWidth") | ||
| 139 | Text("Whole Screen").tag(0) | ||
| 140 | ForEach([60, 70, 80, 90, 100, 120], id: \.self) { Text("\($0) columns").tag($0) } | ||
| 141 | if ![0, 60, 70, 80, 90, 100, 120].contains(width) { Text("\(width) columns").tag(width) } | ||
| 142 | } | ||
| 143 | } header: { | ||
| 144 | Text("Appearance") | ||
| 145 | } footer: { | ||
| 146 | Text("With a Body Font, prose uses it while tables, code, dates, tags and drawers keep the monospaced font. Text Width keeps lines to that many columns, centred, on a screen wider than that.") | ||
| 125 | } | 147 | } |
| 126 | calendarSection | 148 | calendarSection |
| 127 | reminderSection | 149 | reminderSection |
| @@ -274,6 +296,12 @@ struct SettingsScreen: View { | |||
| 274 | model.set(key, to: .string(value)) | 296 | model.set(key, to: .string(value)) |
| 275 | } | 297 | } |
| 276 | 298 | ||
| 299 | /// Installed proportional font families, for prose. | ||
| 300 | private static let proportionalFamilies: [String] = UIFont.familyNames.sorted().filter { family in | ||
| 301 | guard let name = UIFont.fontNames(forFamilyName: family).first, let font = UIFont(name: name, size: 13) else { return false } | ||
| 302 | return !font.fontDescriptor.symbolicTraits.contains(.traitMonoSpace) | ||
| 303 | } | ||
| 304 | |||
| 277 | /// The span and start day, worded as the Mac's Settings word the start. | 305 | /// The span and start day, worded as the Mac's Settings word the start. |
| 278 | private var agenda: String { | 306 | private var agenda: String { |
| 279 | func days(_ count: Int) -> String { count == 1 ? "1 day" : "\(count) days" } | 307 | func days(_ count: Int) -> String { count == 1 ? "1 day" : "\(count) days" } |
docs/manual/guide/14-ios.org +1 −1 · view
| @@ -85,7 +85,7 @@ Files that aren't valid UTF-8 open read-only; commands that would change them sa | |||
| 85 | 85 | ||
| 86 | The editor and the reader use the theme set in the configuration folder's =config.toml=, stacked as on the Mac: the themes chosen with =light-theme= and =dark-theme=, then the theme file named by =theme-file=, then the colours in =[theme]=, =[theme.light]=, =[theme.dark]=, =[theme.todo]= and =[theme.category]=. A TODO keyword without a colour in =[theme.todo]= takes its class's colour: =todo-next= for =NEXT= and =STRT=, =todo-waiting= for =WAIT= and =HOLD=, =todo-cancelled= for =KILL= and =CANCELLED=, and so on (see [[file:13-configuration.org][Configuration]] for the lists). Colours follow the system's light or dark appearance. Problems in the theme show in the Settings tab with the other problems. A change to =config.toml= or the theme file applies as it syncs, to open editors too. See [[file:13-configuration.org][Configuration]] for the colour keys. | 86 | The editor and the reader use the theme set in the configuration folder's =config.toml=, stacked as on the Mac: the themes chosen with =light-theme= and =dark-theme=, then the theme file named by =theme-file=, then the colours in =[theme]=, =[theme.light]=, =[theme.dark]=, =[theme.todo]= and =[theme.category]=. A TODO keyword without a colour in =[theme.todo]= takes its class's colour: =todo-next= for =NEXT= and =STRT=, =todo-waiting= for =WAIT= and =HOLD=, =todo-cancelled= for =KILL= and =CANCELLED=, and so on (see [[file:13-configuration.org][Configuration]] for the lists). Colours follow the system's light or dark appearance. Problems in the theme show in the Settings tab with the other problems. A change to =config.toml= or the theme file applies as it syncs, to open editors too. See [[file:13-configuration.org][Configuration]] for the colour keys. |
| 87 | 87 | ||
| 88 | Settings ▸ Light Theme and Dark Theme choose the built-in themes, shown as a few lines of Org in each theme's colours; with a configuration folder the choice is written to its =config.toml=, so the Mac uses it too. Settings ▸ App Icon chooses the home screen icon from the same thirteen as the Mac; iOS confirms the change. The icon is chosen per device. | 88 | Settings ▸ Light Theme and Dark Theme choose the built-in themes, shown as a few lines of Org in each theme's colours; with a configuration folder the choice is written to its =config.toml=, so the Mac uses it too. Settings ▸ App Icon chooses the home screen icon from the same thirteen as the Mac; iOS confirms the change. The icon is chosen per device. Settings ▸ Body Font (=body-font=: Same as Font, System or an installed proportional family) and Text Width (=text-width=: Whole Screen or 60 to 120 columns) are written the same way. |
| 89 | 89 | ||
| 90 | - Font :: =font= when that family is installed on the device, otherwise the system's monospaced font. =body-font=, when set, is used for prose as on the Mac. | 90 | - Font :: =font= when that family is installed on the device, otherwise the system's monospaced font. =body-font=, when set, is used for prose as on the Mac. |
| 91 | - Size :: =font-size= is the size at the default Dynamic Type setting, 13 pt by default. Text grows and shrinks with the text size chosen in the system Settings app. | 91 | - Size :: =font-size= is the size at the default Dynamic Type setting, 13 pt by default. Text grows and shrinks with the text size chosen in the system Settings app. |
l10n/Localizable.xcstrings +136 · view
| @@ -5279,6 +5279,40 @@ | |||
| 5279 | } | 5279 | } |
| 5280 | } | 5280 | } |
| 5281 | }, | 5281 | }, |
| 5282 | "Body Font": { | ||
| 5283 | "localizations": { | ||
| 5284 | "de": { | ||
| 5285 | "stringUnit": { | ||
| 5286 | "state": "translated", | ||
| 5287 | "value": "Schrift für Fließtext" | ||
| 5288 | } | ||
| 5289 | }, | ||
| 5290 | "es": { | ||
| 5291 | "stringUnit": { | ||
| 5292 | "state": "translated", | ||
| 5293 | "value": "Tipo de letra del cuerpo" | ||
| 5294 | } | ||
| 5295 | }, | ||
| 5296 | "fr": { | ||
| 5297 | "stringUnit": { | ||
| 5298 | "state": "translated", | ||
| 5299 | "value": "Police du texte courant" | ||
| 5300 | } | ||
| 5301 | }, | ||
| 5302 | "ja": { | ||
| 5303 | "stringUnit": { | ||
| 5304 | "state": "translated", | ||
| 5305 | "value": "本文のフォント" | ||
| 5306 | } | ||
| 5307 | }, | ||
| 5308 | "pt-BR": { | ||
| 5309 | "stringUnit": { | ||
| 5310 | "state": "translated", | ||
| 5311 | "value": "Fonte do Corpo" | ||
| 5312 | } | ||
| 5313 | } | ||
| 5314 | } | ||
| 5315 | }, | ||
| 5282 | "Body Only": { | 5316 | "Body Only": { |
| 5283 | "localizations": { | 5317 | "localizations": { |
| 5284 | "de": { | 5318 | "de": { |
| @@ -36245,6 +36279,40 @@ | |||
| 36245 | } | 36279 | } |
| 36246 | } | 36280 | } |
| 36247 | }, | 36281 | }, |
| 36282 | "Text Width": { | ||
| 36283 | "localizations": { | ||
| 36284 | "de": { | ||
| 36285 | "stringUnit": { | ||
| 36286 | "state": "translated", | ||
| 36287 | "value": "Textbreite" | ||
| 36288 | } | ||
| 36289 | }, | ||
| 36290 | "es": { | ||
| 36291 | "stringUnit": { | ||
| 36292 | "state": "translated", | ||
| 36293 | "value": "Ancho del texto" | ||
| 36294 | } | ||
| 36295 | }, | ||
| 36296 | "fr": { | ||
| 36297 | "stringUnit": { | ||
| 36298 | "state": "translated", | ||
| 36299 | "value": "Largeur du texte" | ||
| 36300 | } | ||
| 36301 | }, | ||
| 36302 | "ja": { | ||
| 36303 | "stringUnit": { | ||
| 36304 | "state": "translated", | ||
| 36305 | "value": "テキスト幅" | ||
| 36306 | } | ||
| 36307 | }, | ||
| 36308 | "pt-BR": { | ||
| 36309 | "stringUnit": { | ||
| 36310 | "state": "translated", | ||
| 36311 | "value": "Largura do Texto" | ||
| 36312 | } | ||
| 36313 | } | ||
| 36314 | } | ||
| 36315 | }, | ||
| 36248 | "Text width": { | 36316 | "Text width": { |
| 36249 | "localizations": { | 36317 | "localizations": { |
| 36250 | "de": { | 36318 | "de": { |
| @@ -39890,6 +39958,40 @@ | |||
| 39890 | } | 39958 | } |
| 39891 | } | 39959 | } |
| 39892 | }, | 39960 | }, |
| 39961 | "Whole Screen": { | ||
| 39962 | "localizations": { | ||
| 39963 | "de": { | ||
| 39964 | "stringUnit": { | ||
| 39965 | "state": "translated", | ||
| 39966 | "value": "Ganzer Bildschirm" | ||
| 39967 | } | ||
| 39968 | }, | ||
| 39969 | "es": { | ||
| 39970 | "stringUnit": { | ||
| 39971 | "state": "translated", | ||
| 39972 | "value": "Toda la pantalla" | ||
| 39973 | } | ||
| 39974 | }, | ||
| 39975 | "fr": { | ||
| 39976 | "stringUnit": { | ||
| 39977 | "state": "translated", | ||
| 39978 | "value": "Écran entier" | ||
| 39979 | } | ||
| 39980 | }, | ||
| 39981 | "ja": { | ||
| 39982 | "stringUnit": { | ||
| 39983 | "state": "translated", | ||
| 39984 | "value": "画面全体" | ||
| 39985 | } | ||
| 39986 | }, | ||
| 39987 | "pt-BR": { | ||
| 39988 | "stringUnit": { | ||
| 39989 | "state": "translated", | ||
| 39990 | "value": "Tela Inteira" | ||
| 39991 | } | ||
| 39992 | } | ||
| 39993 | } | ||
| 39994 | }, | ||
| 39893 | "Whole editor": { | 39995 | "Whole editor": { |
| 39894 | "localizations": { | 39996 | "localizations": { |
| 39895 | "de": { | 39997 | "de": { |
| @@ -40027,6 +40129,40 @@ | |||
| 40027 | } | 40129 | } |
| 40028 | } | 40130 | } |
| 40029 | }, | 40131 | }, |
| 40132 | "With a Body Font, prose uses it while tables, code, dates, tags and drawers keep the monospaced font. Text Width keeps lines to that many columns, centred, on a screen wider than that.": { | ||
| 40133 | "localizations": { | ||
| 40134 | "de": { | ||
| 40135 | "stringUnit": { | ||
| 40136 | "state": "translated", | ||
| 40137 | "value": "Mit einer Schrift für Fließtext wird Prosa in ihr gesetzt, während Tabellen, Code, Daten, Tags und Schubladen die Festbreitenschrift behalten. Die Textbreite begrenzt Zeilen auf so viele Spalten, zentriert, auf einem breiteren Bildschirm." | ||
| 40138 | } | ||
| 40139 | }, | ||
| 40140 | "es": { | ||
| 40141 | "stringUnit": { | ||
| 40142 | "state": "translated", | ||
| 40143 | "value": "Con un tipo de letra del cuerpo, la prosa lo usa mientras las tablas, el código, las fechas, las etiquetas y los cajones mantienen el tipo monoespaciado. El ancho del texto limita las líneas a esas columnas, centradas, en una pantalla más ancha." | ||
| 40144 | } | ||
| 40145 | }, | ||
| 40146 | "fr": { | ||
| 40147 | "stringUnit": { | ||
| 40148 | "state": "translated", | ||
| 40149 | "value": "Avec une police du texte courant, la prose l'utilise tandis que les tableaux, le code, les dates, les étiquettes et les tiroirs gardent la police à chasse fixe. La largeur du texte limite les lignes à ce nombre de colonnes, centrées, sur un écran plus large." | ||
| 40150 | } | ||
| 40151 | }, | ||
| 40152 | "ja": { | ||
| 40153 | "stringUnit": { | ||
| 40154 | "state": "translated", | ||
| 40155 | "value": "本文のフォントを設定すると、文章にはそのフォントが使われ、表、コード、日付、タグ、ドロワーは等幅フォントのままです。テキスト幅は、それより広い画面で行をその桁数に収めて中央に置きます。" | ||
| 40156 | } | ||
| 40157 | }, | ||
| 40158 | "pt-BR": { | ||
| 40159 | "stringUnit": { | ||
| 40160 | "state": "translated", | ||
| 40161 | "value": "Com uma Fonte do Corpo, a prosa a usa enquanto tabelas, código, datas, tags e gavetas mantêm a fonte monoespaçada. A Largura do Texto limita as linhas a essa quantidade de colunas, centralizadas, em uma tela mais larga." | ||
| 40162 | } | ||
| 40163 | } | ||
| 40164 | } | ||
| 40165 | }, | ||
| 40030 | "Word Count": { | 40166 | "Word Count": { |
| 40031 | "localizations": { | 40167 | "localizations": { |
| 40032 | "de": { | 40168 | "de": { |