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

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 1 05:15:59 UTC 2020


 loleaflet/css/mobilewizard.css                   |   15 ++++++++++-
 loleaflet/src/control/Control.JSDialogBuilder.js |   30 ++++++++++++++++++++++-
 loleaflet/src/control/Control.MobileWizard.js    |   18 +++++++++++--
 3 files changed, 58 insertions(+), 5 deletions(-)

New commits:
commit d2f6af52c0751fbfb6adfabe19d68b95c6160384
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Mar 19 12:13:25 2020 +0000
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 1 07:15:38 2020 +0200

    phone: include border style setting with custom control.
    
    Change-Id: I763b31fc1021f03d3229b6162d4e182ba0383d8a
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90746
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index eb1933445..84da0c98f 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -299,7 +299,20 @@
 		border: none !important;
 		padding: 0px 0px 16px 0px;
 	}
-
+	#mobile-wizard-content > #ScCellAppearancePropertyPanel > .ui-content.level-0.mobile-wizard{
+		display: flex;
+		justify-content: center;
+		align-items: start;
+		align-self: start;
+		flex-wrap: wrap;
+	}
+	#mobile-wizard-content > #ScCellAppearancePropertyPanel > .ui-content.level-0.mobile-wizard .borderbutton {
+		width: 42px;
+		padding: 1px;
+		background-color: #eeeeee;
+		-webkit-box-shadow: inset 0px 0px 0px 2px #fff;
+		box-shadow: inset 0px 0px 0px 2px #fff;
+	}
 	.ui-header.mobile-wizard {
 		width: 100%;
 		height: 56px !important;
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 08d5552fb..862c218a4 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -55,6 +55,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['colorsample'] = this._colorSampleControl;
 		this._controlHandlers['divcontainer'] = this._divContainerHandler;
 		this._controlHandlers['colorlistbox'] = this._colorControl;
+		this._controlHandlers['borderstyle'] = this._borderControl;
 
 		this._controlHandlers['mainmenu'] = this._containerHandler;
 		this._controlHandlers['submenu'] = this._subMenuHandler;
@@ -1412,10 +1413,37 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		$(sectionTitle).click(function () {
 			builder.callback('toolbutton', 'click', sectionTitle, data.command, builder);
 		});
-
 		return false;
 	},
 
+	_borderControlItem: function(parentContainer, data, builder, i) {
+		var button = null;
+
+		var div = this._createIdentifiable('div', 'ui-content unospan', parentContainer, data);
+
+		var buttonId = 'border-' + i;
+		button = L.DomUtil.create('img', 'ui-content borderbutton', div);
+		button.src = 'images/fr0' + i + '.svg';
+		button.id = buttonId;
+
+		$(div).click(function () {
+			var color = 0;
+			// Find our associated color picker
+			var item = L.LOUtil.findItemWithAttributeRecursive(data.parent, 'command', '.uno:FrameLineColor');
+			if (item)
+				color = builder._getCurrentColor(item, builder);
+			window.setBorderStyle(i, color);
+		});
+	},
+
+	_borderControl: function(parentContainer, data, builder) {
+		var bordercontrollabel = L.DomUtil.create('p', 'mobile-wizard ui-text', parentContainer);
+		bordercontrollabel.innerHTML = _('Cell borders');
+		bordercontrollabel.id = data.id + 'label';
+		for (var i = 1; i < 13; ++i)
+			builder._borderControlItem(parentContainer, data, builder, i);
+	},
+
 	_colorControl: function(parentContainer, data, builder) {
 		var titleOverride = builder._getTitleForControlWithId(data.id);
 		if (titleOverride)
diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js
index ca8486600..2edb21c75 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -361,6 +361,17 @@ L.Control.MobileWizard = L.Control.extend({
 		}
 	},
 
+	_insertCalcBorders: function(deck) {
+		var replaceMe = L.LOUtil.findItemWithAttributeRecursive(deck, 'id', 'cellbordertype');
+		if (replaceMe) {
+			replaceMe.id = 'borderstyle';
+			replaceMe.type = 'borderstyle';
+			replaceMe.text = '';
+			replaceMe.enabled = 'true';
+			replaceMe.children = [];
+		}
+	},
+
 	_modifySidebarLayout: function (data) {
 		var deck = L.LOUtil.findItemWithAttributeRecursive(data, 'type', 'deck');
 		if (deck)
@@ -379,15 +390,16 @@ L.Control.MobileWizard = L.Control.extend({
 				deck.children[textIdx].children[0].children = moveContent.concat(deck.children[textIdx].children[0].children);
 				deck.children.splice(stylesIdx, 1); //remove the styles property
 			}
-			var removeItems = ['cellbordertype', 'borderlinestyle', 'borderlinecolor',
-					   'editcontour', 'spacingbar', 'linespacing',
-					   'stylenew', 'styleupdate',
+			var removeItems = ['borderlinestyle', 'editcontour', 'spacingbar',
+					   'linespacing', 'stylenew', 'styleupdate',
 					   'beginarrowstyle', 'endarrowstyle'];
 
 			if (this.map.getDocType() === 'presentation')
 				removeItems.push('indentfieldbox');
 
 			this._removeItems(deck, removeItems);
+
+			this._insertCalcBorders(deck);
 		}
 	},
 


More information about the Libreoffice-commits mailing list