loleaflet/images/lc_presentation.svg                |    1 
 loleaflet/src/control/Control.NotebookbarBuilder.js |   11 ++++++-
 loleaflet/src/control/Control.NotebookbarImpress.js |   31 ++++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit 9d5c80c6fdcbdfab2d37e963dd36fe7643076b35
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Fri May 8 11:18:54 2020 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri May 8 14:02:21 2020 +0200

    notebookbar: custom shortcuts for impress
    
    Change-Id: I5a2803091522e20416a6ba05f968590d7d105b0a
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93708
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/loleaflet/images/lc_presentation.svg 
b/loleaflet/images/lc_presentation.svg
new file mode 100644
index 000000000..f7d561a22
--- /dev/null
+++ b/loleaflet/images/lc_presentation.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg";><path d="m2 
6v15h11.601562a5.5 5.5 0 0 1 -.390624-1h-10.210938v-13h18v6.607422a5.5 5.5 0 0 
1 1 .652344v-8.259766z" fill="#808080"/><path d="m1 3h22v2h-22z" 
fill="#4d82b8"/><path d="m3 7v13h10.210938a5.5 5.5 0 0 1 -.210938-1.5 5.5 5.5 0 
0 1 5.5-5.5 5.5 5.5 0 0 1 2.5.607422v-6.607422z" fill="#fff"/><path d="m18.5 
14a4.5 4.5 0 0 0 -4.5 4.5 4.5 4.5 0 0 0 4.5 4.5 4.5 4.5 0 0 0 4.5-4.5 4.5 4.5 0 
0 0 -4.5-4.5zm0 1a3.5 3.5 0 0 1 3.5 3.5 3.5 3.5 0 0 1 -3.5 3.5 3.5 3.5 0 0 1 
-3.5-3.5 3.5 3.5 0 0 1 3.5-3.5z" fill="#808080"/><circle cx="18.5" cy="18.5" 
fill="#fff" r="3.5"/><path d="m17 21 4-2.5-4-2.5z" fill="#4d82b8" 
fill-rule="evenodd"/><path d="m5 9h14v2h-14z" fill="#eac282"/></svg>
\ No newline at end of file
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 237e9c497..4a91b8e56 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -40,6 +40,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
                this._toolitemHandlers['.uno:BasicShapes'] = 
this._shapesControl;
                this._toolitemHandlers['.uno:ConditionalFormatMenu'] = 
this._conditionalFormatControl;
                this._toolitemHandlers['.uno:SetDefault'] = 
this._clearFormattingControl;
+               this._toolitemHandlers['.uno:Presentation'] = 
this._startPresentationControl;
 
                this._toolitemHandlers['.uno:SelectWidth'] = function() {};
                this._toolitemHandlers['.uno:SetOutline'] = function() {};
@@ -91,7 +92,6 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
                this._toolitemHandlers['.uno:EditDoc'] = function() {};
                this._toolitemHandlers['.uno:AssignLayout'] = function() {};
                this._toolitemHandlers['.uno:ConnectorToolbox'] = function() {};
-               this._toolitemHandlers['.uno:Presentation'] = function() {};
                this._toolitemHandlers['.uno:PresentationCurrentSlide'] = 
function() {};
                this._toolitemHandlers['.uno:PresentationLayout'] = function() 
{};
                this._toolitemHandlers['.uno:FontworkGalleryFloater'] = 
function() {};
@@ -380,6 +380,15 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
                });
        },
 
+       _startPresentationControl: function(parentContainer, data, builder) {
+               var control = builder._unoToolButton(parentContainer, data, 
builder);
+
+               $(control.container).unbind('click');
+               $(control.container).click(function () {
+                       builder.map.fire('fullscreen');
+               });
+       },
+
        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 d1a983014..f36ae8511 100644
--- a/loleaflet/src/control/Control.NotebookbarImpress.js
+++ b/loleaflet/src/control/Control.NotebookbarImpress.js
@@ -6,6 +6,37 @@
 /* global */
 L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
 
+       getShortcutsBarData: function() {
+               return [
+                       {
+                               'id': 'shortcutstoolbox',
+                               'type': 'toolbox',
+                               'children': [
+                                       {
+                                               'type': 'toolitem',
+                                               'text': 'Save',
+                                               'command': '.uno:Save'
+                                       },
+                                       {
+                                               'type': 'toolitem',
+                                               'text': 'Start Presentation',
+                                               'command': '.uno:Presentation'
+                                       },
+                                       {
+                                               'type': 'toolitem',
+                                               'text': 'Undo',
+                                               'command': '.uno:Undo'
+                                       },
+                                       {
+                                               'type': 'toolitem',
+                                               'text': 'Redo',
+                                               'command': '.uno:Redo'
+                                       }
+                               ]
+                       }
+               ];
+       },
+
        selectedTab: function(tabText) {
                switch (tabText) {
                case 'HomeLabel':
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to