[DE] Fix Bug 53938

This commit is contained in:
Julia Radzhabova 2021-12-09 18:23:59 +03:00
parent 2f5db86f23
commit 4bed1f8ed6
3 changed files with 23 additions and 3 deletions

View file

@ -278,7 +278,9 @@ define([
/** coauthoring end **/
'<tr class="themes">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'<td class="right">',
'<div><div id="fms-cmb-theme" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<div id="fms-chb-dark-mode" style="display: inline-block; vertical-align: middle;margin-top: 2px;"></div></div></td>',
'</tr>','<tr class="divider"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strZoom %></label></td>',
@ -547,6 +549,16 @@ define([
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
}).on('selected', function(combo, record) {
me.chDarkMode.setDisabled(record.themeType!=='dark');
});
this.chDarkMode = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-dark-mode'),
labelText: this.txtDarkMode,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.cmbReviewHover = new Common.UI.ComboBox({
@ -636,6 +648,7 @@ define([
if ( !Common.UI.Themes.available() ) {
$('tr.themes, tr.themes + tr.divider', this.el).hide();
}
this.chDarkMode.setVisible(!/^pdf|djvu|xps|oxps$/.test(DE.getController('Main').document.fileType));
},
setApi: function(o) {
@ -700,7 +713,7 @@ define([
var data = [];
for (var t in Common.UI.Themes.map()) {
data.push({value: t, displayValue: Common.UI.Themes.get(t).text});
data.push({value: t, displayValue: Common.UI.Themes.get(t).text, themeType: Common.UI.Themes.get(t).type});
}
if ( data.length ) {
@ -708,6 +721,8 @@ define([
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.currentThemeId()});
this.cmbTheme.setValue(item ? item.get('value') : Common.UI.Themes.defaultThemeId());
}
this.chDarkMode.setValue(Common.UI.Themes.isContentThemeDark());
this.chDarkMode.setDisabled(!Common.UI.Themes.isDarkTheme());
if (this.mode.canViewReview) {
value = Common.Utils.InternalSettings.get("de-settings-review-hover-mode");
@ -718,6 +733,8 @@ define([
applySettings: function() {
Common.UI.Themes.setTheme(this.cmbTheme.getValue());
if (!this.chDarkMode.isDisabled() && (this.chDarkMode.isChecked() !== Common.UI.Themes.isContentThemeDark()))
Common.UI.Themes.toggleContentTheme();
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"));
@ -852,7 +869,8 @@ define([
txtAutoCorrect: 'AutoCorrect options...',
strReviewHover: 'Track Changes Display',
txtChangesTip: 'Show by hover in tooltips',
txtChangesBalloons: 'Show by click in balloons'
txtChangesBalloons: 'Show by click in balloons',
txtDarkMode: 'Turn on document dark mode'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -1723,6 +1723,7 @@
"DE.Views.FileMenuPanels.Settings.strSpellCheckMode": "Turn on spell checking option",
"DE.Views.FileMenuPanels.Settings.strStrict": "Strict",
"DE.Views.FileMenuPanels.Settings.strTheme": "Interface theme",
"DE.Views.FileMenuPanels.Settings.txtDarkMode": "Turn on document dark mode",
"DE.Views.FileMenuPanels.Settings.strUnit": "Unit of Measurement",
"DE.Views.FileMenuPanels.Settings.strZoom": "Default Zoom Value",
"DE.Views.FileMenuPanels.Settings.text10Minutes": "Every 10 Minutes",

View file

@ -1723,6 +1723,7 @@
"DE.Views.FileMenuPanels.Settings.strSpellCheckMode": "Включить проверку орфографии",
"DE.Views.FileMenuPanels.Settings.strStrict": "Строгий",
"DE.Views.FileMenuPanels.Settings.strTheme": "Тема интерфейса",
"DE.Views.FileMenuPanels.Settings.txtDarkMode": "Включить темный режим",
"DE.Views.FileMenuPanels.Settings.strUnit": "Единица измерения",
"DE.Views.FileMenuPanels.Settings.strZoom": "Стандартное значение масштаба",
"DE.Views.FileMenuPanels.Settings.text10Minutes": "Каждые 10 минут",