diff options
author | niu tech <jerzyglowacki@gmail.com> | 2021-11-12 23:52:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-13 04:22:58 +0530 |
commit | ad17ec5ccad3ceffd383f228d4529438b5a3b9a6 (patch) | |
tree | f8cb939e8a1ae8d24126d37dfcd7e4b00c85eba0 /src/components/settings | |
parent | New Crowdin updates (#2219) (diff) | |
download | ferdium-app-ad17ec5ccad3ceffd383f228d4529438b5a3b9a6.tar.gz ferdium-app-ad17ec5ccad3ceffd383f228d4529438b5a3b9a6.tar.zst ferdium-app-ad17ec5ccad3ceffd383f228d4529438b5a3b9a6.zip |
Adjust number of columns for Split Mode (#2208)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'src/components/settings')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 9e8fb3cf5..589bb4538 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -17,6 +17,8 @@ import { | |||
17 | DEFAULT_APP_SETTINGS, | 17 | DEFAULT_APP_SETTINGS, |
18 | FRANZ_TRANSLATION, | 18 | FRANZ_TRANSLATION, |
19 | GITHUB_FRANZ_URL, | 19 | GITHUB_FRANZ_URL, |
20 | SPLIT_COLUMNS_MAX, | ||
21 | SPLIT_COLUMNS_MIN, | ||
20 | } from '../../../config'; | 22 | } from '../../../config'; |
21 | import { isMac, isWindows, lockFerdiShortcutKey } from '../../../environment'; | 23 | import { isMac, isWindows, lockFerdiShortcutKey } from '../../../environment'; |
22 | import { | 24 | import { |
@@ -178,6 +180,10 @@ const messages = defineMessages({ | |||
178 | defaultMessage: | 180 | defaultMessage: |
179 | 'Official translations are English & German. All other languages are community based translations.', | 181 | 'Official translations are English & German. All other languages are community based translations.', |
180 | }, | 182 | }, |
183 | numberOfColumns: { | ||
184 | id: 'settings.app.form.splitColumns', | ||
185 | defaultMessage: 'Number of columns', | ||
186 | }, | ||
181 | }); | 187 | }); |
182 | 188 | ||
183 | const Hr = () => <hr style={{ marginBottom: 20 }} />; | 189 | const Hr = () => <hr style={{ marginBottom: 20 }} />; |
@@ -200,6 +206,7 @@ class EditSettingsForm extends Component { | |||
200 | automaticUpdates: PropTypes.bool.isRequired, | 206 | automaticUpdates: PropTypes.bool.isRequired, |
201 | isDarkmodeEnabled: PropTypes.bool.isRequired, | 207 | isDarkmodeEnabled: PropTypes.bool.isRequired, |
202 | isAdaptableDarkModeEnabled: PropTypes.bool.isRequired, | 208 | isAdaptableDarkModeEnabled: PropTypes.bool.isRequired, |
209 | isSplitModeEnabled: PropTypes.bool.isRequired, | ||
203 | isNightlyEnabled: PropTypes.bool.isRequired, | 210 | isNightlyEnabled: PropTypes.bool.isRequired, |
204 | hasAddedTodosAsService: PropTypes.bool.isRequired, | 211 | hasAddedTodosAsService: PropTypes.bool.isRequired, |
205 | isOnline: PropTypes.bool.isRequired, | 212 | isOnline: PropTypes.bool.isRequired, |
@@ -246,6 +253,7 @@ class EditSettingsForm extends Component { | |||
246 | getCacheSize, | 253 | getCacheSize, |
247 | automaticUpdates, | 254 | automaticUpdates, |
248 | isDarkmodeEnabled, | 255 | isDarkmodeEnabled, |
256 | isSplitModeEnabled, | ||
249 | isTodosActivated, | 257 | isTodosActivated, |
250 | isNightlyEnabled, | 258 | isNightlyEnabled, |
251 | hasAddedTodosAsService, | 259 | hasAddedTodosAsService, |
@@ -538,6 +546,16 @@ class EditSettingsForm extends Component { | |||
538 | <Hr /> | 546 | <Hr /> |
539 | 547 | ||
540 | <Toggle field={form.$('splitMode')} /> | 548 | <Toggle field={form.$('splitMode')} /> |
549 | {isSplitModeEnabled && ( | ||
550 | <Input | ||
551 | type="number" | ||
552 | min={SPLIT_COLUMNS_MIN} | ||
553 | max={SPLIT_COLUMNS_MAX} | ||
554 | placeholder={intl.formatMessage(messages.numberOfColumns)} | ||
555 | onChange={e => this.submit(e)} | ||
556 | field={form.$('splitColumns')} | ||
557 | /> | ||
558 | )} | ||
541 | 559 | ||
542 | <Hr /> | 560 | <Hr /> |
543 | 561 | ||