' +
@@ -171,6 +172,9 @@ define([
me.chRightMenu.on('change', _.bind(function (checkbox, state) {
me.fireEvent('rightmenu:hide', [me.chRightMenu, state === 'checked']);
}, me));
+ me.btnDarkDocument.on('click', _.bind(function (e) {
+ me.fireEvent('darkmode:change', [e.pressed]);
+ }, me));
me.btnMacros && me.btnMacros.on('click', function () {
me.fireEvent('macros:click');
});
@@ -384,6 +388,18 @@ define([
});
this.lockedControls.push(this.btnInterfaceTheme);
+ this.btnDarkDocument = new Common.UI.Button({
+ cls: 'btn-toolbar x-huge icon-top',
+ iconCls: 'toolbar__icon btn-dark-mode',
+ lock: [_set.inLightTheme],
+ caption: this.textDarkDocument,
+ enableToggle: true,
+ dataHint: '1',
+ dataHintDirection: 'bottom',
+ dataHintOffset: 'small'
+ });
+ this.lockedControls.push(this.btnDarkDocument);
+
this.chFormula = new Common.UI.CheckBox({
labelText: this.textFormula,
value: !Common.localStorage.getBool('sse-hidden-formula'),
@@ -454,6 +470,7 @@ define([
this.cmbZoom.setValue(100);
$host.find('#slot-lbl-zoom').text(this.textZoom);
this.btnInterfaceTheme.render($host.find('#slot-btn-interface-theme'));
+ this.btnDarkDocument.render($host.find('#slot-btn-dark-document'));
this.chFormula.render($host.find('#slot-chk-formula'));
this.chStatusbar.render($host.find('#slot-chk-statusbar'));
this.chToolbar.render($host.find('#slot-chk-toolbar'));
@@ -490,6 +507,7 @@ define([
}
me.btnMacros && me.btnMacros.updateHint(me.tipMacros);
me.btnInterfaceTheme.updateHint(me.tipInterfaceTheme);
+ me.btnDarkDocument.updateHint(me.tipDarkDocument);
me.btnRecMacro && me.btnRecMacro.updateHint(me.tipRecMacro);
me.btnPauseMacro && me.btnPauseMacro.updateHint(me.tipPauseMacro);
@@ -618,7 +636,13 @@ define([
me.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) {
var value = item.value;
Common.UI.Themes.setTheme(value);
+ Common.Utils.lockControls(Common.enumLock.inLightTheme, !Common.UI.Themes.isDarkTheme(), {array: [me.btnDarkDocument]});
}, me));
+
+ setTimeout(function () {
+ me.btnDarkDocument.toggle(Common.UI.Themes.isContentThemeDark(), true);
+ Common.Utils.lockControls(Common.enumLock.inLightTheme, !Common.UI.Themes.isDarkTheme(), {array: [me.btnDarkDocument]});
+ }, 0);
}
}
@@ -736,6 +760,8 @@ define([
textInterfaceTheme: 'Interface theme',
textShowFrozenPanesShadow: 'Show frozen panes shadow',
tipInterfaceTheme: 'Interface theme',
+ textDarkDocument: 'Dark document',
+ tipDarkDocument: 'Dark document',
textLeftMenu: 'Left panel',
textRightMenu: 'Right panel',
txtViewNormal: 'Normal',
diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/icons.svg b/apps/spreadsheeteditor/main/resources/img/toolbar/icons.svg
index aa0c3e139d..67e880a550 100644
--- a/apps/spreadsheeteditor/main/resources/img/toolbar/icons.svg
+++ b/apps/spreadsheeteditor/main/resources/img/toolbar/icons.svg
@@ -832,6 +832,10 @@
+
+
+
+
diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/v2/2.5x/big/btn-dark-mode.svg b/apps/spreadsheeteditor/main/resources/img/toolbar/v2/2.5x/big/btn-dark-mode.svg
new file mode 100644
index 0000000000..885cbad213
--- /dev/null
+++ b/apps/spreadsheeteditor/main/resources/img/toolbar/v2/2.5x/big/btn-dark-mode.svg
@@ -0,0 +1,5 @@
+