Skip to content

Commit

Permalink
Shortcuts-bar remove menubar
Browse files Browse the repository at this point in the history
all commands from menubar was added to the notebookbar
so no need for the hamburger menubar button

Signed-off-by: andreas kainz <kainz.a@gmail.com>
Change-Id: Icb283b40c269d2f92a29ad16dba8dda9d0f860d2
  • Loading branch information
Andreas-Kainz authored and pedropintosilva committed Feb 24, 2022
1 parent a4f53ab commit a2935d5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 153 deletions.
6 changes: 0 additions & 6 deletions browser/src/control/Control.Notebookbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
135 changes: 0 additions & 135 deletions browser/src/control/Control.NotebookbarBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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: '&#8250;'
});

$(menuHtml[0]).children('a').html('<img class="ui-content unobutton" src="' + L.LOUtil.getImageURL('lc_hamburger.svg') + '" id="Hamburgerimg" alt="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];
Expand Down
6 changes: 0 additions & 6 deletions browser/src/control/Control.NotebookbarDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 0 additions & 6 deletions browser/src/control/Control.NotebookbarImpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a2935d5

Please sign in to comment.