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 @@