[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-3' - loleaflet/images loleaflet/src

mert (via logerrit) logerrit at kemper.freedesktop.org
Thu May 7 05:26:42 UTC 2020


 loleaflet/images/lc_pageheight.svg               |   13 +++++++++++++
 loleaflet/images/lc_pagewidth.svg                |    1 +
 loleaflet/images/lc_paperheight.svg              |   13 +++++++++++++
 loleaflet/images/lc_paperwidth.svg               |    1 +
 loleaflet/src/control/Control.JSDialogBuilder.js |   16 +++++++++++++++-
 loleaflet/src/control/Control.Menubar.js         |   16 ++++++----------
 loleaflet/src/control/Control.MobileWizard.js    |    4 ++++
 loleaflet/src/layer/tile/TileLayer.js            |    2 +-
 8 files changed, 54 insertions(+), 12 deletions(-)

New commits:
commit a5d14f2f72bee5c8ff5918ca1f6385a5655d2d25
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Wed Apr 29 17:30:35 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 7 07:26:25 2020 +0200

    mobile: sidebar page deck for Page Settings as mobilewizard
    
    Change-Id: I67cc40cb4fca4b9607e2c42d83ce66cc9bdd1eb8
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93170
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 89526f85e3768a30f7d8f3c5050e64cd05c018af)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93536

diff --git a/loleaflet/images/lc_pageheight.svg b/loleaflet/images/lc_pageheight.svg
new file mode 100644
index 000000000..9441c1bc3
--- /dev/null
+++ b/loleaflet/images/lc_pageheight.svg
@@ -0,0 +1,13 @@
+<svg version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path d="m5 3v18h14v-14.271l-4-3.7294z" fill="#fff"/>
+ <path d="m5 2c-0.554 0-1 0.446-1 1v18c0 0.554 0.446 1 1 1h14c0.554 0 1-0.446 1-1v-13.959c0-0.45068 0.09887-0.4266-0.60464-1.0676l-3.3074-3.237c-0.70952-0.73686-0.71122-0.73686-1.0948-0.73686h-0.99317zm0 1h9v4c0 0.554 0.446 1 1 1h4v13h-14z" fill="#808080"/>
+ <path d="m15 7h4l-4-4z" fill="#fff" fill-rule="evenodd"/>
+ <rect transform="rotate(90)" x="2" y="-6" width="20" height="4" ry="1" fill="#eac282"/>
+ <g transform="rotate(90,10,10)" fill="#808080">
+  <path d="m5 14h1v2h-1z"/>
+  <path d="m8 14h1v2h-1z"/>
+  <path d="m11 14h1v2h-1z"/>
+  <path d="m14 14h1v2h-1z"/>
+  <path d="m17 14h1v2h-1z"/>
+ </g>
+</svg>
diff --git a/loleaflet/images/lc_pagewidth.svg b/loleaflet/images/lc_pagewidth.svg
new file mode 100644
index 000000000..606f02d19
--- /dev/null
+++ b/loleaflet/images/lc_pagewidth.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m5 3v18h14v-14.2705905l-4-3.7294095z" fill="#fff"/><path d="m5 2c-.554 0-1 .446-1 1v18c0 .554.446 1 1 1h14c.554 0 1-.446 1-1v-10.109375-3.6412209-.2079239c0-.4506799.09887-.4265951-.604637-1.0675892l-3.307389-3.2370335c-.709525-.7368575-.711223-.7368575-1.094804-.7368575h-.331557-.661613zm0 1h9v4c0 .554.446 1 1 1h4v13h-14z" fill="#808080"/><path d="m15 7h4l-4-4z" fill="#fff" fill-rule="evenodd"/><rect fill="#eac282" height="4" ry="1" width="20" x="2" y="14"/><g fill="#808080"><path d="m5 14h1v2h-1z"/><path d="m8 14h1v2h-1z"/><path d="m11 14h1v2h-1z"/><path d="m14 14h1v2h-1z"/><path d="m17 14h1v2h-1z"/></g></svg>
\ No newline at end of file
diff --git a/loleaflet/images/lc_paperheight.svg b/loleaflet/images/lc_paperheight.svg
new file mode 100644
index 000000000..9441c1bc3
--- /dev/null
+++ b/loleaflet/images/lc_paperheight.svg
@@ -0,0 +1,13 @@
+<svg version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path d="m5 3v18h14v-14.271l-4-3.7294z" fill="#fff"/>
+ <path d="m5 2c-0.554 0-1 0.446-1 1v18c0 0.554 0.446 1 1 1h14c0.554 0 1-0.446 1-1v-13.959c0-0.45068 0.09887-0.4266-0.60464-1.0676l-3.3074-3.237c-0.70952-0.73686-0.71122-0.73686-1.0948-0.73686h-0.99317zm0 1h9v4c0 0.554 0.446 1 1 1h4v13h-14z" fill="#808080"/>
+ <path d="m15 7h4l-4-4z" fill="#fff" fill-rule="evenodd"/>
+ <rect transform="rotate(90)" x="2" y="-6" width="20" height="4" ry="1" fill="#eac282"/>
+ <g transform="rotate(90,10,10)" fill="#808080">
+  <path d="m5 14h1v2h-1z"/>
+  <path d="m8 14h1v2h-1z"/>
+  <path d="m11 14h1v2h-1z"/>
+  <path d="m14 14h1v2h-1z"/>
+  <path d="m17 14h1v2h-1z"/>
+ </g>
+</svg>
diff --git a/loleaflet/images/lc_paperwidth.svg b/loleaflet/images/lc_paperwidth.svg
new file mode 100644
index 000000000..606f02d19
--- /dev/null
+++ b/loleaflet/images/lc_paperwidth.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m5 3v18h14v-14.2705905l-4-3.7294095z" fill="#fff"/><path d="m5 2c-.554 0-1 .446-1 1v18c0 .554.446 1 1 1h14c.554 0 1-.446 1-1v-10.109375-3.6412209-.2079239c0-.4506799.09887-.4265951-.604637-1.0675892l-3.307389-3.2370335c-.709525-.7368575-.711223-.7368575-1.094804-.7368575h-.331557-.661613zm0 1h9v4c0 .554.446 1 1 1h4v13h-14z" fill="#808080"/><path d="m15 7h4l-4-4z" fill="#fff" fill-rule="evenodd"/><rect fill="#eac282" height="4" ry="1" width="20" x="2" y="14"/><g fill="#808080"><path d="m5 14h1v2h-1z"/><path d="m8 14h1v2h-1z"/><path d="m11 14h1v2h-1z"/><path d="m14 14h1v2h-1z"/><path d="m17 14h1v2h-1z"/></g></svg>
\ No newline at end of file
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 2390d11e1..b4179fa60 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -141,6 +141,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['calcfuncpanel'] = this._calcFuncListPanelHandler;
 		this._controlHandlers['tabcontrol'] = this._tabsControlHandler;
 		this._controlHandlers['paneltabs'] = this._panelTabsHandler;
+		this._controlHandlers['singlepanel'] = this._singlePanelHandler;
 		this._controlHandlers['container'] = this._containerHandler;
 		this._controlHandlers['window'] = this._containerHandler;
 		this._controlHandlers['borderwindow'] = this._containerHandler;
@@ -739,6 +740,15 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return false;
 	},
 
+	_singlePanelHandler: function(parentContainer, data, builder) {
+		var item = data[0];
+		if (item.children) {
+			var child = item.children[0];
+			builder.build(parentContainer, [child]);
+		}
+		return false;
+	},
+
 	_radiobuttonControl: function(parentContainer, data, builder) {
 		var radiobutton = L.DomUtil.createWithId('input', data.id, parentContainer);
 		radiobutton.type = 'radio';
@@ -2068,7 +2078,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			    && childData.children[0] && childData.children[0].type == 'panel'
 			    && childData.children[1] && childData.children[1].type == 'panel';
 
-			if (twoPanelsAsChildren) {
+			if (childData.children && childData.children.length == 1
+				&& childData.children[0] && childData.children[0].type == 'panel') {
+				handler = this._controlHandlers['singlepanel'];
+				processChildren = handler(childObject, childData.children, this);
+			} else if (twoPanelsAsChildren) {
 				handler = this._controlHandlers['paneltabs'];
 				processChildren = handler(childObject, childData.children, this);
 			} else {
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 9649055af..d2ef6b36d 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -514,10 +514,7 @@ L.Control.Menubar = L.Control.extend({
 				{uno: '.uno:PreviousTrackedChange'},
 				{uno: '.uno:NextTrackedChange'}
 			]},
-			{name: _('Page Setup'), id: 'pagesetup', type: 'menu', menu: [
-				{name: _('Portrait'), id: 'setportrait', uno: '.uno:ToggleOrientation'},
-				{name: _('Landscape'), id: 'setlandscape', uno: '.uno:ToggleOrientation'}
-			]},
+			{name: _('Page Setup'), id: 'pagesetup', type: 'action'},
 			{name: _UNO('.uno:ViewMenu', 'text'), id: 'view', type: 'menu', menu: [
 				{uno: '.uno:ControlCodes'},
 				{uno: '.uno:SpellOnline'},
@@ -1234,6 +1231,10 @@ L.Control.Menubar = L.Control.extend({
 			this._map.sendUnoCommand('.uno:InsertPageTitleField');
 		} else if (id === 'insertslidesfield') {
 			this._map.sendUnoCommand('.uno:InsertPagesField');
+		} else if (id === 'pagesetup') {
+			this._map.sendUnoCommand('.uno:LOKSidebarWriterPage');
+			this._map.fire('showwizardsidebar');
+			window.pageMobileWizard = true;
 		}
 		// Inform the host if asked
 		if (postmessage)
@@ -1331,12 +1332,6 @@ L.Control.Menubar = L.Control.extend({
 		if (menuItem.id === 'signdocument' && (L.DomUtil.get('document-signing-bar') === null)) {
 			return false;
 		}
-		if (menuItem.id === 'setportrait' && this._map['stateChangeHandler'].getItemValue('.uno:Orientation') === 'IsPortrait') {
-			return false;
-		}
-		else if (menuItem.id === 'setlandscape' && this._map['stateChangeHandler'].getItemValue('.uno:Orientation') === 'IsLandscape') {
-			return false;
-		}
 		if (this._map._permission === 'readonly' && menuItem.type === 'menu') {
 			var found = false;
 			for (var j in this.options.allowedReadonlyMenus) {
@@ -1352,6 +1347,7 @@ L.Control.Menubar = L.Control.extend({
 			switch (menuItem.id) {
 			case 'last-mod':
 			case 'save':
+			case 'pagesetup':
 				return false;
 			}
 		}
diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js
index 3f59a0606..926f9f707 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -110,6 +110,10 @@ L.Control.MobileWizard = L.Control.extend({
 		if (window.insertionMobileWizard === true)
 			window.insertionMobileWizard = false;
 
+		if (window.pageMobileWizard === true)
+			window.pageMobilewizard = false;
+
+
 		this._updateToolbarItemStateByClose();
 
 		if (!this.map.hasFocus()) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 9836590ba..1947bc894 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2250,7 +2250,7 @@ L.TileLayer = L.GridLayer.extend({
 			this._map._textInput.showCursor();
 
 			// Don't show the keyboard when the Wizard is visible.
-			if (!window.mobileWizard) {
+			if (!window.mobileWizard && !window.pageMobileWizard && !window.insertionMobileWizard) {
 				// If the user is editing, show the keyboard, but don't change
 				// anything if nothing is changed.
 				this._map.focus(true);


More information about the Libreoffice-commits mailing list