[dark theme] added ui themes switcher

This commit is contained in:
Maxim Kadushkin 2021-02-06 13:06:33 +03:00
parent f938e668ef
commit 900a179f7e
6 changed files with 80 additions and 1 deletions

View file

@ -240,6 +240,10 @@ define([
'<td class="right"><span id="fms-cmb-show-changes"></span></td>',
'</tr>','<tr class="divider coauth changes"></tr>',
/** coauthoring end **/
'<tr class="edit">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strZoom %></label></td>',
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr"></div></td>',
@ -446,6 +450,18 @@ define([
});
this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this));
this.cmbTheme = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-theme'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 'theme-light', displayValue: this.txtThemeLight },
{ value: 'theme-dark', displayValue: this.txtThemeDark }
]
});
this.btnApply = new Common.UI.Button({
el: $markup.findById('#fms-btn-apply')
});
@ -564,9 +580,14 @@ define([
this.lblMacrosDesc.text(item ? item.get('descValue') : this.txtWarnMacrosDesc);
this.chPaste.setValue(Common.Utils.InternalSettings.get("de-settings-paste-button"));
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.current()});
this.cmbTheme.setValue(item ? item.get('value') : 0);
},
applySettings: function() {
Common.UI.Themes.setTheme(this.cmbTheme.getValue());
Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue());
Common.Utils.InternalSettings.set("de-settings-zoom", Common.localStorage.getItem("de-settings-zoom"));
@ -689,6 +710,9 @@ define([
strPaste: 'Cut, copy and paste',
strPasteButton: 'Show Paste Options button when content is pasted',
txtProofing: 'Proofing',
strTheme: 'Theme',
txtThemeLight: 'Light',
txtThemeDark: 'Dark',
txtAutoCorrect: 'AutoCorrect options...'
}, DE.Views.FileMenuPanels.Settings || {}));

View file

@ -1649,6 +1649,9 @@
"DE.Views.FileMenuPanels.Settings.txtWarnMacros": "Show Notification",
"DE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification",
"DE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"DE.Views.FileMenuPanels.Settings.strTheme": "Theme",
"DE.Views.FileMenuPanels.Settings.txtThemeLight": "Light",
"DE.Views.FileMenuPanels.Settings.txtThemeDark": "Dark",
"DE.Views.FormSettings.textCheckbox": "Checkbox",
"DE.Views.FormSettings.textColor": "Border color",
"DE.Views.FormSettings.textComb": "Comb of characters",

View file

@ -214,6 +214,10 @@ define([
'<label id="fms-lbl-coauth-mode" style="vertical-align: middle;"><%= scope.strCoAuthModeDescFast %></label></div></td>',
'</tr>','<tr class="divider coauth changes"></tr>',
/** coauthoring end **/
'<tr class="edit">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strZoom %></label></td>',
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr"></div></td>',
@ -389,6 +393,17 @@ define([
});
this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this));
this.cmbTheme = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-theme'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 'theme-light', displayValue: this.txtThemeLight },
{ value: 'theme-dark', displayValue: this.txtThemeDark }
]
});
this.btnApply = new Common.UI.Button({
el: $markup.findById('#fms-btn-apply')
});
@ -496,9 +511,14 @@ define([
this.lblMacrosDesc.text(item ? item.get('descValue') : this.txtWarnMacrosDesc);
this.chPaste.setValue(Common.Utils.InternalSettings.get("pe-settings-paste-button"));
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.current()});
this.cmbTheme.setValue(item ? item.get('value') : 0);
},
applySettings: function() {
Common.UI.Themes.setTheme(this.cmbTheme.getValue());
Common.localStorage.setItem("pe-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0);
Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0);
Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue());
@ -595,6 +615,9 @@ define([
strPaste: 'Cut, copy and paste',
strPasteButton: 'Show Paste Options button when content is pasted',
txtProofing: 'Proofing',
strTheme: 'Theme',
txtThemeLight: 'Light',
txtThemeDark: 'Dark',
txtAutoCorrect: 'AutoCorrect options...'
}, PE.Views.FileMenuPanels.Settings || {}));

View file

@ -1302,6 +1302,9 @@
"PE.Views.FileMenuPanels.Settings.txtWarnMacros": "Show Notification",
"PE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification",
"PE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"PE.Views.FileMenuPanels.Settings.strTheme": "Theme",
"PE.Views.FileMenuPanels.Settings.txtThemeLight": "Light",
"PE.Views.FileMenuPanels.Settings.txtThemeDark": "Dark",
"PE.Views.HeaderFooterDialog.applyAllText": "Apply to all",
"PE.Views.HeaderFooterDialog.applyText": "Apply",
"PE.Views.HeaderFooterDialog.diffLanguage": "You cant use a date format in a different language than the slide master.<br>To change the master, click 'Apply to all' instead of 'Apply'",

View file

@ -691,6 +691,10 @@ define([
'<label id="fms-lbl-coauth-mode" style="vertical-align: middle;"><%= scope.strCoAuthModeDescFast %></label></div></td>',
'</tr>','<tr class="divider coauth changes"></tr>',
/** coauthoring end **/
'<tr class="edit">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strZoom %></label></td>',
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr"></div></td>',
@ -995,6 +999,17 @@ define([
labelText: this.strPasteButton
});
this.cmbTheme = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-theme'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 'theme-light', displayValue: this.txtThemeLight },
{ value: 'theme-dark', displayValue: this.txtThemeDark }
]
});
this.btnApply = new Common.UI.Button({
el: $markup.findById('#fms-btn-apply')
});
@ -1141,9 +1156,14 @@ define([
this.lblMacrosDesc.text(item ? item.get('descValue') : this.txtWarnMacrosDesc);
this.chPaste.setValue(Common.Utils.InternalSettings.get("sse-settings-paste-button"));
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.current()});
this.cmbTheme.setValue(item ? item.get('value') : 0);
},
applySettings: function() {
Common.UI.Themes.setTheme(this.cmbTheme.getValue());
Common.localStorage.setItem("sse-settings-zoom", this.cmbZoom.getValue());
Common.Utils.InternalSettings.set("sse-settings-zoom", Common.localStorage.getItem("sse-settings-zoom"));
/** coauthoring begin **/
@ -1289,6 +1309,9 @@ define([
txtRunMacrosDesc: 'Enable all macros without notification',
txtStopMacrosDesc: 'Disable all macros without notification',
strPaste: 'Cut, copy and paste',
strTheme: 'Theme',
txtThemeLight: 'Light',
txtThemeDark: 'Dark',
strPasteButton: 'Show Paste Options button when content is pasted'
}, SSE.Views.FileMenuPanels.MainSettingsGeneral || {}));

View file

@ -1803,6 +1803,9 @@
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWarnMacros": "Show Notification",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWarnMacrosDesc": "Disable all macros with a notification",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWin": "as Windows",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strTheme": "Theme",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtThemeLight": "Light",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtThemeDark": "Dark",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.okButtonText": "Apply",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strDictionaryLanguage": "Dictionary language",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strIgnoreWordsInUPPERCASE": "Ignore words in UPPERCASE",