diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 38864b0f0..aa9afdb7f 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -111,6 +111,27 @@ define([ me.view.turnNavigation(state); }); } + + var menuItems = [], + currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); + for (var t in Common.UI.Themes.map()) { + menuItems.push({ + value: t, + caption: Common.UI.Themes.get(t).text, + checked: t === currentTheme, + checkable: true, + toggleGroup: 'interface-theme' + }); + } + + if ( menuItems.length ) { + this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); + this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { + var value = item.value; + Common.UI.Themes.setTheme(value); + this.view.btnDarkDocument.setDisabled(value !== 'theme-dark'); + }, this)); + } }, }, DE.Controllers.ViewTab || {})); diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template index e53c53322..a00ce3b84 100644 --- a/apps/documenteditor/main/app/template/Toolbar.template +++ b/apps/documenteditor/main/app/template/Toolbar.template @@ -198,6 +198,7 @@
+
diff --git a/apps/documenteditor/main/app/view/ViewTab.js b/apps/documenteditor/main/app/view/ViewTab.js index cc94834b5..a5a40be8e 100644 --- a/apps/documenteditor/main/app/view/ViewTab.js +++ b/apps/documenteditor/main/app/view/ViewTab.js @@ -137,6 +137,17 @@ define([ }); this.lockedControls.push(this.btnInterfaceTheme); + this.btnDarkDocument = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-dark-document'), + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon night', + caption: this.textDarkDocument, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnDarkDocument); + this.chStatusbar = new Common.UI.CheckBox({ el: $host.findById('#slot-chk-statusbar'), labelText: this.textStatusBar, @@ -205,7 +216,8 @@ define([ textInterfaceTheme: 'Interface theme', textStatusBar: 'Status Bar', textAlwaysShowToolbar: 'Always show toolbar', - textRulers: 'Rulers' + textRulers: 'Rulers', + textDarkDocument: 'Dark document' } }()), DE.Views.ViewTab || {})); }); \ No newline at end of file