From a2935d55e14a6e546f302abde019c2ca36676fcd Mon Sep 17 00:00:00 2001 From: andreas kainz Date: Wed, 23 Feb 2022 20:22:55 +0100 Subject: [PATCH] Shortcuts-bar remove menubar all commands from menubar was added to the notebookbar so no need for the hamburger menubar button Signed-off-by: andreas kainz Change-Id: Icb283b40c269d2f92a29ad16dba8dda9d0f860d2 --- browser/src/control/Control.Notebookbar.js | 6 - .../src/control/Control.NotebookbarBuilder.js | 135 ------------------ .../src/control/Control.NotebookbarDraw.js | 6 - .../src/control/Control.NotebookbarImpress.js | 6 - 4 files changed, 153 deletions(-) diff --git a/browser/src/control/Control.Notebookbar.js b/browser/src/control/Control.Notebookbar.js index f4c455076..106580485 100644 --- a/browser/src/control/Control.Notebookbar.js +++ b/browser/src/control/Control.Notebookbar.js @@ -243,12 +243,6 @@ L.Control.Notebookbar = L.Control.extend({ 'id': 'shortcutstoolbox', 'type': 'toolbox', 'children': [ - { - 'id': 'menu', - 'type': 'toolitem', - 'text': _('Menu'), - 'command': '.uno:Menubar' - }, { 'id': 'save', 'type': 'toolitem', diff --git a/browser/src/control/Control.NotebookbarBuilder.js b/browser/src/control/Control.NotebookbarBuilder.js index bd618911b..0333bb7d4 100644 --- a/browser/src/control/Control.NotebookbarBuilder.js +++ b/browser/src/control/Control.NotebookbarBuilder.js @@ -54,7 +54,6 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._toolitemHandlers['.uno:shareas'] = this._shareAsControl; this._toolitemHandlers['.uno:Print'] = this._printControl; this._toolitemHandlers['.uno:rev-history'] = this._revHistoryControl; - this._toolitemHandlers['.uno:Menubar'] = this._menubarControl; this._toolitemHandlers['.uno:InsertPageHeader'] = this._headerFooterControl; this._toolitemHandlers['.uno:InsertPageFooter'] = this._headerFooterControl; this._toolitemHandlers['.uno:Text'] = this._insertTextBoxControl; @@ -968,140 +967,6 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ return false; }, - _menubarControl: function(parentContainer, data, builder) { - var control = builder._unoToolButton(parentContainer, data, builder); - - $(control.container).unbind('click.toolbutton'); - $(control.container).tooltip({disabled: true}); - $(control.container).addClass('sm sm-simple lo-menu'); - - var disabledMacros = window.enableMacrosExecution === 'false'; - - var menu = { - text: [ - {id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [ - {uno: '.uno:SelectAll'}, - {name: _('Show Ruler'), id: 'showruler', type: 'action'}, - {type: 'separator'}, - {name: _UNO('.uno:ChangesMenu', 'text'), id: 'changesmenu', type: 'menu', menu: [ - {uno: '.uno:TrackChanges'}, - {uno: '.uno:ShowTrackedChanges'}, - {type: 'separator'}, - {uno: '.uno:AcceptTrackedChanges'}, - {uno: '.uno:AcceptAllTrackedChanges'}, - {uno: '.uno:RejectAllTrackedChanges'}, - {uno: '.uno:PreviousTrackedChange'}, - {uno: '.uno:NextTrackedChange'} - ]}, - {uno: '.uno:SearchDialog'}, - {type: 'separator'}, - {name: _('Repair'), id: 'repair', type: 'action'}, - {name: _UNO('.uno:ToolsMenu', 'text'), id: 'tools', type: 'menu', menu: [ - {uno: '.uno:SpellingAndGrammarDialog'}, - {uno: '.uno:SpellOnline'}, - {uno: '.uno:ThesaurusDialog'}, - {uno: '.uno:WordCountDialog'}, - {uno: '.uno:LineNumberingDialog'}, - {type: 'separator'}, - {uno: '.uno:RunMacro', hidden: disabledMacros}, - {type: 'separator', hidden: disabledMacros}, - {name: _UNO('.uno:AutoFormatMenu', 'text'), type: 'menu', menu: [ - {uno: '.uno:OnlineAutoFormat'}]} - ]} - ]} - ], - spreadsheet: [ - {id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [ - {uno: '.uno:SelectAll'}, - {type: 'separator'}, - {uno: '.uno:SearchDialog'}, - {type: 'separator'}, - {name: _('Repair'), id: 'repair', type: 'action'}, - {name: _UNO('.uno:ToolsMenu', 'spreadsheet'), id: 'tools', type: 'menu', menu: [ - {uno: '.uno:SpellDialog'}, - {uno: '.uno:SpellOnline'}, - {uno: '.uno:GoalSeekDialog'}, - {type: 'separator', hidden: disabledMacros}, - {uno: '.uno:RunMacro', hidden: disabledMacros} - ]} - ]} - ], - presentation: [ - {id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [ - {uno: '.uno:SelectAll'}, - {type: 'separator'}, - {uno: '.uno:SlideMasterPage'}, - {type: 'separator'}, - {uno: '.uno:ModifyPage'}, - {uno: '.uno:SlideChangeWindow'}, - {uno: '.uno:CustomAnimation'}, - {uno: '.uno:MasterSlidesPanel'}, - {type: 'separator'}, - {uno: '.uno:SearchDialog'}, - {type: 'separator'}, - {name: _('Repair'), id: 'repair', type: 'action'}, - {name: _UNO('.uno:ToolsMenu', 'presentation'), id: 'tools', type: 'menu', menu: [ - {uno: '.uno:SpellDialog'}, - {uno: '.uno:SpellOnline'}, - {type: 'separator', hidden: disabledMacros}, - {uno: '.uno:RunMacro', hidden: disabledMacros} - ]}, - ]} - ], - drawing: [ - {id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [ - {type: 'separator'}, - {uno: '.uno:SearchDialog'}, - {type: 'separator'}, - {name: _('Repair'), id: 'repair', type: 'action'}, - {name: _UNO('.uno:ToolsMenu', 'presentation'), id: 'tools', type: 'menu', menu: [ - {uno: '.uno:SpellDialog'}, - {uno: '.uno:SpellOnline'}, - {name: _UNO('.uno:LanguageMenu'), type: 'menu', menu: [ - {name: _('None (Do not check spelling)'), id: 'nonelanguage', uno: '.uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE'}]}, - ]}, - ]} - ] - }; - - var menubar = L.control.menubar({allowedReadonlyMenus: ['nb-hamburger']}); - menubar._map = builder.map; - - var docType = builder.map.getDocType(); - var menuHtml = menubar._createMenu(menu[docType]); - document.getElementById('Menubar').setAttribute('role', 'menu'); - - $(control.container).html(menuHtml); - - $(control.container).smartmenus({ - hideOnClick: true, - showOnClick: true, - hideTimeout: 0, - hideDuration: 0, - hideFunction: null, - showDuration: 0, - showFunction: null, - showTimeout: 0, - collapsibleHideDuration: 0, - collapsibleHideFunction: null, - subIndicatorsPos: 'append', - subIndicatorsText: '›' - }); - - $(menuHtml[0]).children('a').html('Menu'); - $(menuHtml[0]).children('a').click(function () { - $(control.container).smartmenus('menuHideAll'); - }); - - $(control.container).bind('beforeshow.smapi', {self: menubar}, menubar._beforeShow); - $(control.container).bind('click.smapi', {self: menubar}, menubar._onClicked); - $(control.container).bind('select.smapi', {self: menubar}, menubar._onItemSelected); - $(control.container).bind('mouseenter.smapi', {self: menubar}, menubar._onMouseEnter); - $(control.container).bind('mouseleave.smapi', {self: menubar}, menubar._onMouseLeave); - $(control.container).bind('keydown', {self: menubar}, menubar._onKeyDown); - $(control.container).bind('hideAll.smapi', {self: menubar}, menubar._onMouseOut); - }, - buildControl: function(parent, data) { var type = data.type; var handler = this._controlHandlers[type]; diff --git a/browser/src/control/Control.NotebookbarDraw.js b/browser/src/control/Control.NotebookbarDraw.js index e1058f779..be0f75258 100644 --- a/browser/src/control/Control.NotebookbarDraw.js +++ b/browser/src/control/Control.NotebookbarDraw.js @@ -12,12 +12,6 @@ L.Control.NotebookbarDraw = L.Control.NotebookbarImpress.extend({ 'id': 'shortcutstoolbox', 'type': 'toolbox', 'children': [ - { - 'id': 'menu', - 'type': 'toolitem', - 'text': _('Menu'), - 'command': '.uno:Menubar' - }, { 'id': 'save', 'type': 'toolitem', diff --git a/browser/src/control/Control.NotebookbarImpress.js b/browser/src/control/Control.NotebookbarImpress.js index 913d056f3..8ec36aef7 100644 --- a/browser/src/control/Control.NotebookbarImpress.js +++ b/browser/src/control/Control.NotebookbarImpress.js @@ -12,12 +12,6 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({ 'id': 'shortcutstoolbox', 'type': 'toolbox', 'children': [ - { - 'id': 'menu', - 'type': 'toolitem', - 'text': _('Menu'), - 'command': '.uno:Menubar' - }, { 'id': 'save', 'type': 'toolitem',