loleaflet/css/mobilewizard.css                   |    9 +++++++++
 loleaflet/css/notebookbar.css                    |    2 +-
 loleaflet/src/control/Control.JSDialogBuilder.js |   11 +++++++++--
 3 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 3bc5ffc0c0a942c32507c97ed83a1cec5b59f00d
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu May 7 15:26:53 2020 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri May 8 08:34:41 2020 +0200

    jsdialog: introduce disabled state for unobutton
    
    Change-Id: I5b81cbdda56acc64aac8516e3b97697a0c11395c
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93654
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 33f770257..d62cf279b 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -348,6 +348,15 @@ p.mobile-wizard.ui-combobox-text.selected {
        background-color: #e6e6e640;
 }
 
+.unotoolbutton.disabled {
+       color: #707070;
+}
+
+.unotoolbutton.disabled img {
+       -webkit-filter: grayscale(90%);
+       filter: grayscale(90%);
+}
+
 #mobile-wizard-content .ui-content > table > tr > td > table > table > 
tr:first-child > td > img{
        margin-top: 0px !important;
 }
diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css
index 957f36e75..b5572ebe5 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -66,7 +66,7 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, 
#SendToBack.notebookb
        box-shadow: 0 0 0px 4px #e6e6e640 !important;
 }
 
-.unotoolbutton.notebookbar:hover, #clearFormatting.notebookbar div img:hover {
+.unotoolbutton.notebookbar:not(.disabled):hover, #clearFormatting.notebookbar 
div img:hover {
        box-shadow: 0 0 0px 4px #e6e6e6b0;
        border-radius: 0.1px;
        background-color: #e6e6e6b0;
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index b4179fa60..28c0e7544 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1584,6 +1584,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
                                        $(button).addClass('selected');
                                else
                                        $(button).removeClass('selected');
+
+                               if (state && state === 'disabled')
+                                       $(div).addClass('disabled');
+                               else
+                                       $(div).removeClass('disabled');
                        };
 
                        updateFunction();
@@ -1600,8 +1605,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
                }
 
                $(div).click(function () {
-                       builder.refreshSidebar = true;
-                       builder.callback('toolbutton', 'click', button, 
data.command, builder);
+                       if (!$(div).hasClass('disabled')) {
+                               builder.refreshSidebar = true;
+                               builder.callback('toolbutton', 'click', button, 
data.command, builder);
+                       }
                });
 
                if (data.enabled == 'false')
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to