loleaflet/css/notebookbar.css                       |   12 +++++++++++-
 loleaflet/src/control/Control.JSDialogBuilder.js    |    7 ++++++-
 loleaflet/src/control/Control.NotebookbarBuilder.js |   15 ++++++++++-----
 3 files changed, 27 insertions(+), 7 deletions(-)

New commits:
commit c6b583091ecca80e1951f792c6bf4855dc87dd64
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Jul 27 10:54:39 2020 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Jul 27 11:15:42 2020 +0200

    notebookbar: add dropdown arrows
    
    Arrows added for uno buttons with dropdown menu
    
    Change-Id: I273d97def7919e8884ff62b50dde269ac882f911
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99469
    Tested-by: Jenkins
    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 f2683637c..3cad6dbb6 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -126,6 +126,16 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, 
#SendToBack.notebookb
        padding-left: 5px !important;
 }
 
+.unotoolbutton.notebookbar .unoarrow {
+       margin-left: 5px;
+       border: solid #555;
+       border-width: 0 3px 3px 0;
+       display: inline-block;
+       padding: 3px;
+       transform: rotate(45deg);
+       -webkit-transform: rotate(45deg);
+}
+
 .unotoolbutton.notebookbar .unobutton.selected {
        box-shadow: 0 0 0px 4px #e6e6e640 !important;
 }
@@ -221,7 +231,7 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, 
#SendToBack.notebookb
 }
 
 #ControlCodes.notebookbar {
-       margin-left: 30px !important;
+       margin-left: 35px !important;
 }
 
 #fontnamecombobox.notebookbar ~ .select2 {
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 967e2bd7b..3a99fef0d 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1614,7 +1614,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        parentContainer);
        },
 
-       _unoToolButton: function(parentContainer, data, builder) {
+       _unoToolButton: function(parentContainer, data, builder, options) {
                var button = null;
 
                var controls = {};
@@ -1683,6 +1683,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        controls['label'] = button;
                }
 
+               if (options && options.hasDropdownArrow) {
+                       var arrow = L.DomUtil.create('i', 'unoarrow', div);
+                       controls['arrow'] = arrow;
+               }
+
                $(div).click(function () {
                        if (!$(div).hasClass('disabled')) {
                                builder.refreshSidebar = true;
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 33f06ccf0..5dbd14d27 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -372,7 +372,8 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
        },
 
        _insertTableControl: function(parentContainer, data, builder) {
-               var control = builder._unoToolButton(parentContainer, data, 
builder);
+               var options = {hasDropdownArrow: true};
+               var control = builder._unoToolButton(parentContainer, data, 
builder, options);
 
                $(control.container).unbind('click');
                $(control.container).click(function () {
@@ -388,7 +389,8 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
        },
 
        _shapesControl: function(parentContainer, data, builder) {
-               var control = builder._unoToolButton(parentContainer, data, 
builder);
+               var options = {hasDropdownArrow: true};
+               var control = builder._unoToolButton(parentContainer, data, 
builder, options);
 
                $(control.container).unbind('click');
                $(control.container).click(function () {
@@ -404,7 +406,8 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
        },
 
        _conditionalFormatControl: function(parentContainer, data, builder) {
-               var control = builder._unoToolButton(parentContainer, data, 
builder);
+               var options = {hasDropdownArrow: true};
+               var control = builder._unoToolButton(parentContainer, data, 
builder, options);
 
                $(control.container).unbind('click');
                $(control.container).click(function () {
@@ -419,7 +422,8 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
        },
 
        _insertGraphicControl: function(parentContainer, data, builder) {
-               var control = builder._unoToolButton(parentContainer, data, 
builder);
+               var options = {hasDropdownArrow: 
builder.map['wopi'].EnableInsertRemoteImage};
+               var control = builder._unoToolButton(parentContainer, data, 
builder, options);
 
                $(control.container).unbind('click');
                $(control.container).click(function () {
@@ -472,7 +476,8 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
        },
 
        _lineSpacingControl: function(parentContainer, data, builder) {
-               var control = builder._unoToolButton(parentContainer, data, 
builder);
+               var options = {hasDropdownArrow: true};
+               var control = builder._unoToolButton(parentContainer, data, 
builder, options);
 
                $(control.container).unbind('click');
                $(control.container).click(function () {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to