[Libreoffice-commits] online.git: loleaflet/css loleaflet/src
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 30 11:56:37 UTC 2020
loleaflet/css/menubar.css | 43 ---------
loleaflet/css/notebookbar.css | 59 +++++++++++++
loleaflet/src/control/Control.Notebookbar.js | 1
loleaflet/src/control/Control.NotebookbarBuilder.js | 88 ++++++++++++++++++++
loleaflet/src/control/Control.NotebookbarImpress.js | 5 +
5 files changed, 152 insertions(+), 44 deletions(-)
New commits:
commit 1519c773fbacdd1189af27858ef0d2b2b2767e57
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Jul 30 10:06:53 2020 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Jul 30 13:56:17 2020 +0200
notebookbar: fill hamburger menu
Change-Id: I7812e241dd47b8481159342a526813b5061b5b70
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99768
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/loleaflet/css/menubar.css b/loleaflet/css/menubar.css
index 22a505fcd..84e07849b 100644
--- a/loleaflet/css/menubar.css
+++ b/loleaflet/css/menubar.css
@@ -172,49 +172,6 @@
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
-/* Hamburger icon: from shortcutsbar (notebookbar) */
-.notebookbar-shortcuts-bar #Menubar {padding-right: 7px;}
-
-.hasnotebookbar.text-color-indicator #shortcuts-menubar-icon,
-.hasnotebookbar.text-color-indicator #shortcuts-menubar-icon:before,
-.hasnotebookbar.text-color-indicator #shortcuts-menubar-icon:after {
- background: var(--blue1-txt-primary-color);
-}
-.hasnotebookbar.presentation-color-indicator #shortcuts-menubar-icon,
-.hasnotebookbar.presentation-color-indicator #shortcuts-menubar-icon:before,
-.hasnotebookbar.presentation-color-indicator #shortcuts-menubar-icon:after {
- background: var(--orange1-txt-primary-color);
-}
-.hasnotebookbar.spreadsheet-color-indicator #shortcuts-menubar-icon,
-.hasnotebookbar.spreadsheet-color-indicator #shortcuts-menubar-icon:before,
-.hasnotebookbar.spreadsheet-color-indicator #shortcuts-menubar-icon:after {
- background: var(--green0-txt-primary-color);
-}
-
-.hasnotebookbar #shortcuts-menubar-icon,
-.hasnotebookbar #shortcuts-menubar-icon:before,
-.hasnotebookbar #shortcuts-menubar-icon:after {
- position: absolute;
- top: 52%;
- left: 0px;
- height: 1px;
- width: 13px;
- -webkit-transition: all 0.25s;
- transition: all 0.25s;
-}
-
-.hasnotebookbar #shortcuts-menubar-icon:before {
- content: '';
- top: -6px;
- left: 0;
-}
-
-.notebookbar-shortcuts-bar #shortcuts-menubar-icon:after {
- content: '';
- top: 6px;
- left: 0;
-}
-
/* Hamburger icon */
.main-menu-btn-icon,
diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css
index c73a9a742..69fa813ac 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -73,6 +73,65 @@
margin-top: 3px;
}
+/* Hamburger icon: from shortcutsbar (notebookbar) */
+.hasnotebookbar.text-color-indicator #shortcuts-menubar-icon,
+.hasnotebookbar.text-color-indicator #shortcuts-menubar-icon:before,
+.hasnotebookbar.text-color-indicator #shortcuts-menubar-icon:after {
+ background: var(--blue1-txt-primary-color);
+}
+.hasnotebookbar.presentation-color-indicator #shortcuts-menubar-icon,
+.hasnotebookbar.presentation-color-indicator #shortcuts-menubar-icon:before,
+.hasnotebookbar.presentation-color-indicator #shortcuts-menubar-icon:after {
+ background: var(--orange1-txt-primary-color);
+}
+.hasnotebookbar.spreadsheet-color-indicator #shortcuts-menubar-icon,
+.hasnotebookbar.spreadsheet-color-indicator #shortcuts-menubar-icon:before,
+.hasnotebookbar.spreadsheet-color-indicator #shortcuts-menubar-icon:after {
+ background: var(--green0-txt-primary-color);
+}
+
+.hasnotebookbar .notebookbar-shortcuts-bar #Menubar > li > a {
+ cursor: pointer;
+ border: none;
+ background: var(--gray-bg-color);
+ height: 20px;
+}
+
+.hasnotebookbar #shortcuts-menubar-icon {
+ position: absolute;
+ top: 52%;
+ left: 0px;
+ height: 1px;
+ width: 13px;
+ -webkit-transition: all 0.25s;
+ transition: all 0.25s;
+
+ margin-left: 8px;
+}
+
+.hasnotebookbar #shortcuts-menubar-icon:before,
+.hasnotebookbar #shortcuts-menubar-icon:after {
+ position: absolute;
+ top: 52%;
+ left: 0px;
+ height: 1px;
+ width: 13px;
+ -webkit-transition: all 0.25s;
+ transition: all 0.25s;
+}
+
+.hasnotebookbar #shortcuts-menubar-icon:before {
+ content: '';
+ top: -6px;
+ left: 0;
+}
+
+.hasnotebookbar #shortcuts-menubar-icon:after {
+ content: '';
+ top: 6px;
+ left: 0;
+}
+
/* options section */
.notebookbar-options-section {
display: inline;
diff --git a/loleaflet/src/control/Control.Notebookbar.js b/loleaflet/src/control/Control.Notebookbar.js
index f9578c3af..cb1d43d0c 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -148,7 +148,6 @@ L.Control.Notebookbar = L.Control.extend({
$('nav').prepend(shortcutsBar);
var builder = new L.control.notebookbarBuilder({mobileWizard: this, map: this.map, cssClass: 'notebookbar'});
builder.build(shortcutsBar, this.getShortcutsBarData());
- $('#Menubar').html('<span id="shortcuts-menubar-icon"></span>');
},
setCurrentScrollPosition: function() {
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
index e743ae794..25693d59a 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -46,6 +46,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:SetDefault'] = this._clearFormattingControl;
this._toolitemHandlers['.uno:Presentation'] = this._startPresentationControl;
this._toolitemHandlers['.uno:Save'] = this._saveControl;
+ this._toolitemHandlers['.uno:Menubar'] = this._menubarControl;
this._toolitemHandlers['up'] = this._toolbarItemControl;
this._toolitemHandlers['down'] = this._toolbarItemControl;
@@ -538,6 +539,93 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
});
},
+ _menubarControl: function(parentContainer, data, builder) {
+ var control = builder._unoToolButton(parentContainer, data, builder);
+
+ $(control.container).unbind('click');
+ $(control.container).tooltip({disabled: true});
+ $(control.container).addClass('sm sm-simple lo-menu');
+
+ var menu = {
+ text: [
+ {name: _('Menu'), type: 'menu', menu: [
+ {name: _UNO('.uno:FullScreen', 'text'), id: 'fullscreen', type: 'action'},
+ {name: _('Show Ruler'), id: 'showruler', type: 'action'},
+ {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'},
+ {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'},
+ {name: _UNO('.uno:LanguageMenu'), type: 'menu', menu: [
+ {name: _UNO('.uno:SetLanguageSelectionMenu', 'text'), type: 'menu', menu: [
+ {name: _('None (Do not check spelling)'), id: 'noneselection', uno: '.uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE'}]},
+ {name: _UNO('.uno:SetLanguageParagraphMenu', 'text'), type: 'menu', menu: [
+ {name: _('None (Do not check spelling)'), id: 'noneparagraph', uno: '.uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE'}]},
+ {name: _UNO('.uno:SetLanguageAllTextMenu', 'text'), type: 'menu', menu: [
+ {name: _('None (Do not check spelling)'), id: 'nonelanguage', uno: '.uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE'}]}
+ ]},
+ {uno: '.uno:WordCountDialog'},
+ {uno: '.uno:LineNumberingDialog'},
+ {type: 'separator'},
+ {name: _UNO('.uno:AutoFormatMenu', 'text'), type: 'menu', menu: [
+ {uno: '.uno:OnlineAutoFormat'}]}
+ ]}
+ ]}
+ ],
+ spreadsheet: [
+ {name: _('Menu'), type: 'menu', menu: [
+ {name: _UNO('.uno:FullScreen', 'text'), id: 'fullscreen', type: 'action'},
+ ]}
+ ],
+ presentation: [
+ {name: _('Menu'), type: 'menu', menu: [
+ {name: _UNO('.uno:FullScreen', 'text'), id: 'fullscreen', type: 'action'},
+ ]}
+ ]
+ };
+
+ var menubar = L.control.menubar();
+ menubar._map = builder.map;
+
+ var docType = builder.map.getDocType();
+ var menuHtml = menubar._createMenu(menu[docType]);
+
+ $(control.container).html(menuHtml);
+
+ $(control.container).smartmenus({
+ subMenusSubOffsetX: 1,
+ subMenusSubOffsetY: -8
+ });
+
+ $(menuHtml[0]).children('a').html('<span id="shortcuts-menubar-icon"></span>');
+
+ $(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);
+
+ // get languages list
+ var items = builder.map['stateChangeHandler'];
+ var val = items.getItemValue('.uno:LanguageStatus');
+ if (val)
+ menubar._onInitMenu({commandName: '.uno:LanguageStatus', commandValues: [val]});
+ else
+ builder.map.on('commandvalues', menubar._onInitMenu, menubar);
+ },
+
build: function(parent, data, hasVerticalParent, parentHasManyChildren) {
this._amendJSDialogData(data);
diff --git a/loleaflet/src/control/Control.NotebookbarImpress.js b/loleaflet/src/control/Control.NotebookbarImpress.js
index 21b7f1ecb..5ecf920c1 100644
--- a/loleaflet/src/control/Control.NotebookbarImpress.js
+++ b/loleaflet/src/control/Control.NotebookbarImpress.js
@@ -12,6 +12,11 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
'id': 'shortcutstoolbox',
'type': 'toolbox',
'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _('Menu'),
+ 'command': '.uno:Menubar'
+ },
{
'type': 'toolitem',
'text': _('Save'),
More information about the Libreoffice-commits
mailing list