[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - cypress_test/integration_tests loleaflet/css loleaflet/src

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 2 08:42:14 UTC 2020


 cypress_test/integration_tests/common/calc.js |    2 -
 loleaflet/css/spreadsheet.css                 |    2 -
 loleaflet/src/layer/tile/TileLayer.js         |   28 +++++++++++++++++++-------
 3 files changed, 22 insertions(+), 10 deletions(-)

New commits:
commit a3fd0c213fcc63ca30867a81c941283d6709d907
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Jul 9 11:25:25 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 2 10:41:55 2020 +0200

    Make cell markers less heavy on desktop
    
    * Don't show selection resize markers for single cell
      selection on desktop
    * Use smaller autofill marker on desktop, for single cell
      show it in the corner like in the core
    
    Change-Id: Ic36c16213532ec8b615ee808f836b939f35245fd
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98420
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101523
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/cypress_test/integration_tests/common/calc.js b/cypress_test/integration_tests/common/calc.js
index 3c9c86d1e..c9d829987 100644
--- a/cypress_test/integration_tests/common/calc.js
+++ b/cypress_test/integration_tests/common/calc.js
@@ -44,7 +44,7 @@ function clickOnFirstCell(firstClick = true, dblClick = false) {
 		});
 
 	if (firstClick && !dblClick)
-		cy.get('.spreadsheet-cell-resize-marker')
+		cy.get('.spreadsheet-cell-autofill-marker')
 			.should('be.visible');
 	else
 		cy.get('.leaflet-cursor.blinking-cursor')
diff --git a/loleaflet/css/spreadsheet.css b/loleaflet/css/spreadsheet.css
index 6111444a7..8aede8c33 100644
--- a/loleaflet/css/spreadsheet.css
+++ b/loleaflet/css/spreadsheet.css
@@ -217,8 +217,6 @@
 .spreadsheet-cell-autofill-marker {
 	margin-left: 0px;
 	margin-top: 0px;
-	width: 16px;
-	height: 16px;
 	background-image: url('images/cell-autofill-marker.svg');
 	background-size: 100% 100%;
 	background-repeat: no-repeat;
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index eb030a2e6..5bb537f8d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -178,7 +178,7 @@ L.TileLayer = L.GridLayer.extend({
 		this._cellAutofillMarker = L.marker(new L.LatLng(0, 0), {
 			icon: L.divIcon({
 				className: 'spreadsheet-cell-autofill-marker',
-				iconSize: null
+				iconSize: window.mode.isDesktop() ? [8, 8] : [16, 16]
 			}),
 			draggable: true
 		});
@@ -3075,7 +3075,12 @@ L.TileLayer = L.GridLayer.extend({
 	},
 
 	_onUpdateCellResizeMarkers: function () {
-		if (this._selections.getLayers().length !== 0 || (this._cellCursor && !this._isEmptyRectangle(this._cellCursor))) {
+		var singleCellOnDesktop = window.mode.isDesktop()
+									&& !this._cellSelectionArea
+									&& (this._cellCursor && !this._isEmptyRectangle(this._cellCursor));
+
+		if (!singleCellOnDesktop &&
+			(this._selections.getLayers().length !== 0 || (this._cellCursor && !this._isEmptyRectangle(this._cellCursor)))) {
 			if (this._isEmptyRectangle(this._cellSelectionArea) && this._isEmptyRectangle(this._cellCursor)) {
 				return;
 			}
@@ -3103,10 +3108,6 @@ L.TileLayer = L.GridLayer.extend({
 					this._map.addLayer(this._cellAutofillMarker);
 					var cellAutoFillMarkerPoisition = cellRectangle.getCenter();
 					cellAutoFillMarkerPoisition.lat = cellRectangle.getSouth();
-					cellAutoFillMarkerPoisition = this._map.project(cellAutoFillMarkerPoisition);
-					var sizeAutoFill = this._cellAutofillMarker._icon.getBoundingClientRect();
-					cellAutoFillMarkerPoisition = cellAutoFillMarkerPoisition.subtract(new L.Point(sizeAutoFill.width / 2, sizeAutoFill.height / 2));
-					cellAutoFillMarkerPoisition = this._map.unproject(cellAutoFillMarkerPoisition);
 					this._cellAutofillMarker.setLatLng(cellAutoFillMarkerPoisition);
 				}
 				else if (this._cellAutofillMarker) {
@@ -3114,7 +3115,20 @@ L.TileLayer = L.GridLayer.extend({
 				}
 			}
 		}
-		else {
+		else if (singleCellOnDesktop) {
+			cellRectangle = this._cellSelectionArea ? this._cellSelectionArea : this._cellCursor;
+
+			if (this._cellAutoFillArea) {
+				if (!this._cellAutofillMarker.isDragged) {
+					this._map.addLayer(this._cellAutofillMarker);
+					cellAutoFillMarkerPoisition = L.latLng(cellRectangle.getSouth(), cellRectangle.getEast());
+					this._cellAutofillMarker.setLatLng(cellAutoFillMarkerPoisition);
+				}
+			}
+
+			this._map.removeLayer(this._cellResizeMarkerStart);
+			this._map.removeLayer(this._cellResizeMarkerEnd);
+		} else {
 			this._map.removeLayer(this._cellResizeMarkerStart);
 			this._map.removeLayer(this._cellResizeMarkerEnd);
 			this._map.removeLayer(this._cellAutofillMarker);


More information about the Libreoffice-commits mailing list