[Libreoffice-commits] online.git: loleaflet/src

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 18 00:28:45 UTC 2020


 loleaflet/src/control/Control.TopToolbar.js |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 0d2a32fe2a030c5c7f02cbb0912434844d240db9
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Aug 11 13:51:19 2020 -0400
Commit:     Ashod Nakashian <ash at collabora.com>
CommitDate: Tue Aug 18 02:28:26 2020 +0200

    leaflet: hide the splitter on the toolbar if the first
    
    When the toobar buttons to the left of the first splitter
    are hidden, we start the toolbar with a splitter, which
    is aesthetically unpleasant.
    
    Here we special case for the desktop only, because
    tablets and mobiles have a slightly different toolbar.
    Although we should have a similar logic for them too.
    
    Change-Id: I9869433f3ca3391d7ee899a77bb1466fe456f9f2
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100832
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ash at collabora.com>

diff --git a/loleaflet/src/control/Control.TopToolbar.js b/loleaflet/src/control/Control.TopToolbar.js
index 34450e934..2f896e778 100644
--- a/loleaflet/src/control/Control.TopToolbar.js
+++ b/loleaflet/src/control/Control.TopToolbar.js
@@ -373,6 +373,14 @@ L.Control.TopToolbar = L.Control.extend({
 		if (e.HidePrintOption) {
 			w2ui['editbar'].hide('print');
 		}
+
+		// On desktop we only have Save and Print buttons before the first
+		// splitter/break. Hide the splitter if we hid both save and print.
+		// TODO: Apply the same logic to mobile/tablet to avoid beginning with a splitter.
+		if (window.mode.isDesktop() && e.HideSaveOption && e.HidePrintOption) {
+			w2ui['editbar'].hide('savebreak');
+		}
+
 		if (e.EnableInsertRemoteImage === true && w2ui['editbar']) {
 			w2ui['editbar'].hide('insertgraphic');
 			w2ui['editbar'].show('menugraphic');


More information about the Libreoffice-commits mailing list