diff options
author | 2020-04-14 14:56:16 +0530 | |
---|---|---|
committer | 2020-04-14 10:26:16 +0100 | |
commit | 100016e38098ff389b2d6899dee76413da26f2ae (patch) | |
tree | bcb0f69ef87b4fb91905da2a58538d3e8cc828e5 /src/models/Service.js | |
parent | New Crowdin translations (#495) (diff) | |
download | ferdium-app-100016e38098ff389b2d6899dee76413da26f2ae.tar.gz ferdium-app-100016e38098ff389b2d6899dee76413da26f2ae.tar.zst ferdium-app-100016e38098ff389b2d6899dee76413da26f2ae.zip |
Expose Dark Reader settings (#568)
* feat: Expose DarkReader settings to users
- In the service model, expose an object darkReaderSetting which contains brightness, contrast and sepia values.
- In EditServiceScreen, provide 3 form options for brightness, contrast and Sepia. Additionally onSubmit() form, capture the darkreader settings data onto formdata.darkReaderSettings to update in the service
- In EditServiceForm, if darkModeEnabled is checked, show 3 sliders for controlling darkreader settings
- Create a new Slider control and customize it according to the application's theme and dark theme.
- In Webview Recipe, load the darkReader settings from service settings and pass it to the darkReader library.
* feat: Darkreader settings
- Lint fixes
* feat: DarkReader settings
- refactor code in editservicescreen.js
Co-Authored-By: Sampath Kumar Krishnan <sampath3493@gmail.com>
* feat: Darkreader settings
- Fix a crash where service.darkReaderSettings is null while creating a new service
- Remove isDarkModeEnabled prop to EditServiceForm as it is no longer required.
* fix: Update EditServiceScreen
- Set the default value of darkReader Brightness, Contrast and Sepia to undefined as per @vantezzen 's suggestion.
- Updated the check provided by @mahadevans87
Co-authored-by: Sampath Kumar Krishnan <sampath3493@gmail.com>
Co-authored-by: Sampath Kumar Krishnan <sampathBlam@users.noreply.github.com>
Diffstat (limited to 'src/models/Service.js')
-rw-r--r-- | src/models/Service.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index 12a2d4af9..f073ac9fc 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -56,6 +56,8 @@ export default class Service { | |||
56 | 56 | ||
57 | @observable isDarkModeEnabled = false; | 57 | @observable isDarkModeEnabled = false; |
58 | 58 | ||
59 | @observable darkReaderSettings = { brightness: 100, contrast: 90, sepia: 10 }; | ||
60 | |||
59 | @observable spellcheckerLanguage = null; | 61 | @observable spellcheckerLanguage = null; |
60 | 62 | ||
61 | @observable isFirstLoad = true; | 63 | @observable isFirstLoad = true; |
@@ -109,6 +111,8 @@ export default class Service { | |||
109 | 111 | ||
110 | this.isDarkModeEnabled = data.isDarkModeEnabled !== undefined ? data.isDarkModeEnabled : this.isDarkModeEnabled; | 112 | this.isDarkModeEnabled = data.isDarkModeEnabled !== undefined ? data.isDarkModeEnabled : this.isDarkModeEnabled; |
111 | 113 | ||
114 | this.darkReaderSettings = data.darkReaderSettings !== undefined ? data.darkReaderSettings : this.darkReaderSettings; | ||
115 | |||
112 | this.hasCustomUploadedIcon = data.hasCustomIcon !== undefined ? data.hasCustomIcon : this.hasCustomUploadedIcon; | 116 | this.hasCustomUploadedIcon = data.hasCustomIcon !== undefined ? data.hasCustomIcon : this.hasCustomUploadedIcon; |
113 | 117 | ||
114 | this.proxy = data.proxy !== undefined ? data.proxy : this.proxy; | 118 | this.proxy = data.proxy !== undefined ? data.proxy : this.proxy; |
@@ -136,6 +140,7 @@ export default class Service { | |||
136 | id: this.id, | 140 | id: this.id, |
137 | spellcheckerLanguage: this.spellcheckerLanguage, | 141 | spellcheckerLanguage: this.spellcheckerLanguage, |
138 | isDarkModeEnabled: this.isDarkModeEnabled, | 142 | isDarkModeEnabled: this.isDarkModeEnabled, |
143 | darkReaderSettings: this.darkReaderSettings, | ||
139 | team: this.team, | 144 | team: this.team, |
140 | url: this.url, | 145 | url: this.url, |
141 | hasCustomIcon: this.hasCustomIcon, | 146 | hasCustomIcon: this.hasCustomIcon, |