loleaflet/css/notebookbar.css | 18 +++++++++++++ loleaflet/src/control/Control.Notebookbar.js | 35 +++++++++++++++++++++++++++ 2 files changed, 53 insertions(+)
New commits: commit 0752bd238610fc00f7416df06ac94754d68b9536 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Fri May 8 11:05:17 2020 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri May 8 12:27:37 2020 +0200 notebookbar: add shortcuts toolbar Change-Id: Ia6ddecaca2d6940b9d5bc52684527cb6e67b6a37 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93707 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css index b5572ebe5..6f9675180 100644 --- a/loleaflet/css/notebookbar.css +++ b/loleaflet/css/notebookbar.css @@ -27,6 +27,24 @@ cursor: pointer; } +/* shortcuts bar */ + +.notebookbar-shortcuts-bar { + display: inline-block; + position: relative; + z-index: 10000; +} + +.notebookbar-shortcuts-bar .unotoolbutton.notebookbar { + margin-right: 10px; +} + +.notebookbar-shortcuts-bar .unotoolbutton.notebookbar .unobutton { + width: 16px !important; + height: 16px !important; + margin-right: 0px; +} + /* root container */ .notebookbar-scroll-wrapper { diff --git a/loleaflet/src/control/Control.Notebookbar.js b/loleaflet/src/control/Control.Notebookbar.js index f19d124f9..2be2c8443 100644 --- a/loleaflet/src/control/Control.Notebookbar.js +++ b/loleaflet/src/control/Control.Notebookbar.js @@ -33,6 +33,7 @@ L.Control.Notebookbar = L.Control.extend({ setTabs: function(tabs) { $('nav').prepend(tabs); + this.createShortcutsBar(); }, selectedTab: function() { @@ -44,6 +45,40 @@ L.Control.Notebookbar = L.Control.extend({ return []; }, + getShortcutsBarData: function() { + return [ + { + 'id': 'shortcutstoolbox', + 'type': 'toolbox', + 'children': [ + { + 'type': 'toolitem', + 'text': 'Save', + 'command': '.uno:Save' + }, + { + 'type': 'toolitem', + 'text': 'Undo', + 'command': '.uno:Undo' + }, + { + 'type': 'toolitem', + 'text': 'Redo', + 'command': '.uno:Redo' + } + ] + } + ]; + }, + + createShortcutsBar: function() { + var shortcutsBar = L.DomUtil.create('div', 'notebookbar-shortcuts-bar'); + $('nav').prepend(shortcutsBar); + + var builder = new L.control.notebookbarBuilder({mobileWizard: this, map: this.map, cssClass: 'notebookbar'}); + builder.build(shortcutsBar, this.getShortcutsBarData()); + }, + // required, called by builder, not needed in this container setCurrentScrollPosition: function() {}, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits