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

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 4 19:49:54 UTC 2019


 loleaflet/css/toolbar.css                        |    9 ++++
 loleaflet/src/control/Control.JSDialogBuilder.js |   45 ++++++++++-------------
 2 files changed, 30 insertions(+), 24 deletions(-)

New commits:
commit a20b3e612e5c4651906c137e573e8e98db597e26
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Oct 4 19:43:48 2019 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Oct 4 21:49:46 2019 +0200

    jsdialogs: turn uno buttons into icon+label style
    
    Change-Id: I0d102638042af52d66228601df30059a9953c244
    Reviewed-on: https://gerrit.libreoffice.org/80277
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index ac1f1d300..977dd310e 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -820,3 +820,12 @@ tr.useritem > td > img {
 #mobile-wizard-content .ui-content > table > tr > td > table > table > tr:first-child > td > img{
 	margin-top: 0px !important;
 }
+
+.ui-content.unospan {
+	line-height: 32px;
+}
+
+.ui-content.unolabel {
+	display: table-cell;
+	vertical-align: middle;
+}
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index f3be71bce..9dd973877 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -341,18 +341,24 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	_unoToolButton: function(parentContainer, data, builder) {
 		var button = null;
 
+		var span = L.DomUtil.create('span', 'ui-content unospan', parentContainer);
+
 		if (data.command) {
+			var id = data.command.substr('.uno:'.length);
 			var icon = builder._createIconPathFronUnoCommand(data.command);
-			button = L.DomUtil.create('img', 'ui-content unobutton', parentContainer);
+
+			button = L.DomUtil.create('img', 'ui-content unobutton', span);
 			$(button).css('background', 'url(' + icon + ')');
+			button.id = id;
+
+			var label = L.DomUtil.create('label', 'ui-content unolabel', span);
+			label.for = id;
+			label.innerHTML = data.text;
 		} else {
-			button = L.DomUtil.create('button', '', parentContainer);
+			button = L.DomUtil.create('label', 'ui-content unolabel', span);
 			button.innerHTML = builder._cleanText(data.text);
 		}
 
-		if (data.command)
-			button.id = data.command.substr('.uno:'.length);
-
 		$(button).click(function () {
 			builder.callback('toolbutton', 'click', button, data.command, builder);
 		});
commit 4bdfde8022470d7815f57303ce8778d6c3053c8f
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Oct 4 18:44:51 2019 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Oct 4 21:49:36 2019 +0200

    jsdialogs: don't create horizontal containers
    
    Change-Id: Ida34fbc1150456afa99e88820c173358bca097b4
    Reviewed-on: https://gerrit.libreoffice.org/80276
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 23881b83d..f3be71bce 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -33,7 +33,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['combobox'] = this._comboboxControl;
 		this._controlHandlers['listbox'] = this._comboboxControl;
 		this._controlHandlers['fixedtext'] = this._fixedtextControl;
-		this._controlHandlers['grid'] = this._gridHandler;
+		this._controlHandlers['grid'] = this._containerHandler;
 		this._controlHandlers['frame'] = this._frameHandler;
 		this._controlHandlers['panel'] = this._panelHandler;
 		this._controlHandlers['container'] = this._containerHandler;
@@ -403,36 +403,27 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		builder._comboboxControl(parentContainer, data, builder);
 	},
 
-	build: function(parent, data, currentType, currentIsVertival) {
+	build: function(parent, data) {
 		var currentInsertPlace = parent;
 		var currentHorizontalRow = parent;
-		var currentIsContainer = currentType == 'container';
-
-		if (currentIsContainer && !currentIsVertival)
-			currentHorizontalRow = L.DomUtil.create('tr', '', parent);
 
 		for (var childIndex in data) {
 			var childData = data[childIndex];
 			var childType = childData.type;
 			var processChildren = true;
 
-			if (currentIsContainer) {
-				if (currentIsVertival) {
-					currentHorizontalRow = L.DomUtil.create('tr', '', parent);
-					currentInsertPlace = L.DomUtil.create('td', '', currentHorizontalRow);
-				} else
-					currentInsertPlace = L.DomUtil.create('td', '', currentHorizontalRow);
-			}
+			currentHorizontalRow = L.DomUtil.create('tr', '', parent);
+			currentInsertPlace = L.DomUtil.create('td', '', currentHorizontalRow);
 
-			var childIsContainer = (childType == 'container' || childType == 'borderwindow')
-				&& childData.children.length > 1;
-			var childIsVertical = childData.vertical == 'true';
+			var childIsContainer = (childType == 'container' || childType == 'borderwindow'
+				|| childType == 'grid' || childType == 'toolbox') && childData.children.length > 1;
 
 			var childObject = null;
-			if (childIsContainer && childType != 'borderwindow')
+			if (childType != 'borderwindow' && childIsContainer)
 				childObject = L.DomUtil.create('table', '', currentInsertPlace);
-			else
+			else {
 				childObject = currentInsertPlace;
+			}
 
 			var handler = this._controlHandlers[childType];
 
@@ -442,7 +433,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				console.warn('Unsupported control type: \"' + childType + '\"');
 
 			if (processChildren && childData.children != undefined)
-				this.build(childObject, childData.children, childType, childIsVertical);
+				this.build(childObject, childData.children);
 		}
 	}
 });


More information about the Libreoffice-commits mailing list