loleaflet/src/control/Control.ContextMenu.js | 2 - loleaflet/src/control/Control.LokDialog.js | 4 ++- loleaflet/src/control/Control.MobileWizard.js | 8 ++++--- loleaflet/src/control/Control.Toolbar.js | 3 -- loleaflet/src/layer/tile/CalcTileLayer.js | 5 ---- loleaflet/src/layer/tile/GridLayer.js | 29 +++++++++++++++----------- loleaflet/src/layer/tile/ImpressTileLayer.js | 5 ---- loleaflet/src/layer/tile/TileLayer.js | 12 +++++++--- loleaflet/src/layer/tile/WriterTileLayer.js | 1 loleaflet/src/map/Map.js | 13 ++++------- loolkitconfig.xcu | 7 ++++-- 11 files changed, 45 insertions(+), 44 deletions(-)
New commits: commit 5a2ec4ce5c329a15ec8989649b38fda1579a4f38 Author: Andras Timar <andras.ti...@collabora.com> AuthorDate: Thu Dec 12 09:30:38 2019 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Dec 12 09:30:38 2019 +0100 [cp] Use the collabora_svg theme and large icons for the sidebar Change-Id: I8b58c5e3ebe737abfac1f2c124e00bc717c862df diff --git a/loolkitconfig.xcu b/loolkitconfig.xcu index 30feb7f17..afad642f3 100644 --- a/loolkitconfig.xcu +++ b/loolkitconfig.xcu @@ -25,7 +25,10 @@ <!-- Enable thumbnail generation by default (disabling saves CPU time) --> <item oor:path="/org.openoffice.Office.Common/Save/Document"><prop oor:name="GenerateThumbnail" oor:op="fuse"><value>true</value></prop></item> -<!-- Use the colibre_svg theme for the sidebar --> -<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="SymbolStyle" oor:op="fuse"><value>colibre_svg</value></prop></item> +<!-- Use the collabora_svg theme for the sidebar --> +<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="SymbolStyle" oor:op="fuse"><value>collabora_svg</value></prop></item> + +<!-- Use the large icons in the sidebar --> +<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="SidebarIconSize" oor:op="fuse"><value>2</value></prop></item> </oor:items> commit 24812b90dbdeccb34a46a204c94b38f2a5106d8c Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Wed Dec 11 13:12:03 2019 -0500 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Dec 11 21:20:23 2019 +0100 leaflet: sidebar is now always active for mobile but visible on demand Because we can't control the sidebar when in Chart edit mode, we must have it active before we start Chart editing. Besides that, on mobile we show/hide the sidebar quite frequently, and there is no point in activating/deactivating the sidebar on every tap. So we have the sidebar enabled in the background at all times. We then track whether it's visible or not (window.mobileWizard) and show/hide it. Furthermore, we now handle the sidebar close notification from Core, which we don't expect, really, now that we don't close it. However, we need to have a way to re-activate the sidebar when it is closed. Something we don't do right now, and we need to tack the Core sidebar state as we can only toggle the sidebar. Change-Id: Id7774b84cd0604055c708eb0912e17988f5823d2 Reviewed-on: https://gerrit.libreoffice.org/84974 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 0a17ac6bf..4715f0694 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -26,6 +26,7 @@ L.Control.MobileWizard = L.Control.extend({ this.map = map; map.on('mobilewizard', this._onMobileWizard, this); map.on('closemobilewizard', this._hideWizard, this); + map.on('showmobilewizard', this._showWizard, this); this._setupBackButton(); }, @@ -72,7 +73,6 @@ L.Control.MobileWizard = L.Control.extend({ var toolbar = w2ui['actionbar']; if (toolbar && toolbar.get('mobile_wizard').checked) toolbar.uncheck('mobile_wizard'); - this.map.sendUnoCommand('.uno:Sidebar'); window.mobileWizard = false; } @@ -242,8 +242,10 @@ L.Control.MobileWizard = L.Control.extend({ this._reset(); - this._showWizard(); - this._hideKeyboard(); + if (window.mobileWizard) { + this._showWizard(); + this._hideKeyboard(); + } // We can change the sidebar as we want here if (data.id === '') { // sidebar indicator diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 1537062ce..dc6365822 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -339,7 +339,6 @@ function onClick(e, id, item, subItem) { else if (id === 'mobile_wizard') { if (window.mobileWizard) { window.mobileWizard = false; - map.sendUnoCommand('.uno:Sidebar'); map.fire('closemobilewizard'); toolbar.uncheck(id); } @@ -347,7 +346,7 @@ function onClick(e, id, item, subItem) { if (window.insertionMobileWizard) this.onClick(null, 'insertion_mobile_wizard'); window.mobileWizard = true; - map.sendUnoCommand('.uno:Sidebar'); + map.fire('showmobilewizard'); toolbar.check(id); } } diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index e7faca385..d6e406884 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -875,14 +875,18 @@ L.TileLayer = L.GridLayer.extend({ this._map.fire('mobilewizard', data); }, - _closeMobileWizard: function() { - this._map.fire('closemobilewizard'); + _closeMobileWizard: function(data) { + this._map.fire('closemobilewizard', data); }, _onJSDialogMsg: function (textMsg) { - if (window.mode.isMobile() && window.mobileWizard === true) { + if (window.mode.isMobile()) { var msgData = JSON.parse(textMsg.substring('jsdialog:'.length + 1)); - this._openMobileWizard(msgData); + if (msgData.enabled) { + this._openMobileWizard(msgData); + } else { + this._closeMobileWizard(msgData); + } } }, diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index a199716c9..af149f236 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -285,19 +285,16 @@ L.Map = L.Evented.extend({ // Let the first page finish loading then load the sidebar. var map = this; setTimeout(function () { - // This triggers all sidebar decks, so they would - // be loaded and show rather quickly on first use. - // Also, triggers sidebar window creation in the client. + // This triggers all sidebar decks, so they would + // be loaded and show rather quickly on first use. + // Also, triggers sidebar window creation in the client. map._socket.sendMessage('uno .uno:Sidebar'); // HACK: The initial state of sidebar is that the core // thinks it is shown, so the command has to be triggered // once again for it to be visible on the desktop - // (because the first .uno:Sidebar has actually hidden - // that) - if (!window.mode.isMobile() && !window.mode.isTablet() && !window.ThisIsAMobileApp) { - map._socket.sendMessage('uno .uno:Sidebar'); - } + // (because the first .uno:Sidebar has actually hid it) + map._socket.sendMessage('uno .uno:Sidebar'); }, 200); } commit eef0d535b7ed50c89d0b60ce69f092ecf745a816 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Mon Dec 9 21:06:43 2019 -0500 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Dec 11 21:19:40 2019 +0100 leaflet: resize the document-content properly when toggling the sidebar Change-Id: Ia0066effc2b73c2b6312e015bd67d0c7d08f5e61 Reviewed-on: https://gerrit.libreoffice.org/84795 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 18efb9de4..997fb9aac 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -870,7 +870,8 @@ L.Control.LokDialog = L.Control.extend({ }, _onSidebarClose: function(dialogId) { - this._resizeSidebar(dialogId, 0); + var strId = this._toStrId(dialogId); + this._resizeSidebar(strId, 0); delete this._dialogs[dialogId]; if (this._currentDeck) { $('#' + this._currentDeck.strId).remove(); @@ -1059,6 +1060,7 @@ L.Control.LokDialog = L.Control.extend({ this._map.options.documentContainer.style.right = wrapper.offsetWidth + 'px'; else this._map.options.documentContainer.style.right = (width - 15).toString() + 'px'; + var spreadsheetRowColumnFrame = L.DomUtil.get('spreadsheet-row-column-frame'); if (spreadsheetRowColumnFrame) spreadsheetRowColumnFrame.style.right = width.toString() + 'px'; commit e40eb1febe8f608a8dbbb83a658caa6c92eb0742 Author: mert <mert.tu...@collabora.com> AuthorDate: Mon Dec 9 16:33:33 2019 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Dec 11 21:19:35 2019 +0100 Fix shape context menu brings dialogs on mobile Change-Id: I0101242ebd2bf582093545e3f3abf88b01a043af Reviewed-on: https://gerrit.libreoffice.org/84746 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Michael Meeks <michael.me...@collabora.com> diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 6109a7171..137300e13 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -60,7 +60,7 @@ L.Control.ContextMenu = L.Control.extend({ // This black list contains those menu items which should be disabled on mobile even if they // are allowed in general. We need to have only those items here which are also part // of the whitelist, otherwise the menu items are not visible anyway. - mobileBlackList: ['SpellingAndGrammarDialog', 'FontDialog', 'FontDialogForParagraph'] + mobileBlackList: ['SpellingAndGrammarDialog', 'FontDialog', 'FontDialogForParagraph', 'TransformDialog', 'FormatLine', 'FormatArea'] }, commit 60074bbc49dd32df967ed5d1a0cc4d722b4f671d Author: Michael Meeks <michael.me...@collabora.com> AuthorDate: Mon Dec 9 16:37:23 2019 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Dec 11 21:19:30 2019 +0100 prefetch: disable interval timer when we've pre-fetched everything. Change-Id: I9d3b3819b3d9a960aa31f729686315e9e5d6d8e1 diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index d9ff748a3..4db50a473 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -1278,6 +1278,9 @@ L.GridLayer = L.Layer.extend({ var fragment = document.createDocumentFragment(); this._addTiles(finalQueue, fragment); this._level.el.appendChild(fragment); + } else { + clearInterval(this._tilesPreFetcher); + this._tilesPreFetcher = undefined; } }, @@ -1285,8 +1288,10 @@ L.GridLayer = L.Layer.extend({ if (!this._map) { return; } - clearInterval(this._tilesPreFetcher); - clearTimeout(this._preFetchIdle); + if (this._tilesPreFetcher) + clearInterval(this._tilesPreFetcher); + if (this._preFetchIdle) + clearTimeout(this._preFetchIdle); if (resetBorder) { this._preFetchBorder = null; } @@ -1295,6 +1300,7 @@ L.GridLayer = L.Layer.extend({ this._preFetchPart = this._selectedPart; this._preFetchIdle = setTimeout(L.bind(function () { this._tilesPreFetcher = setInterval(L.bind(this._preFetchTiles, this), interval); + this._prefetchIdle = undefined; }, this), idleTime); } }); commit c7adfb705a2a46d49157dd1779f59edb876da908 Author: Michael Meeks <michael.me...@collabora.com> AuthorDate: Mon Dec 9 16:14:26 2019 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Dec 11 21:19:26 2019 +0100 prefetch: cleanup, and avoid constant growth of pre-loading area. We were inadvertently mutating and growing our copy of the bounds to fetch here, causing a chunk of un-necessary rendering load, particularly for spreadsheets. Change-Id: Ia01565c043d1cb0172cabbec16d941dd8b66dd05 diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index abbcea8b3..511a5253e 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -528,7 +528,6 @@ L.CalcTileLayer = L.TileLayer.extend({ } else { // tile outside of the visible area, just remove it - this._preFetchBorder = null; this._removeTile(key); } } @@ -646,10 +645,6 @@ L.CalcTileLayer = L.TileLayer.extend({ }); this._resetPreFetching(true); this._update(); - if (this._preFetchPart !== this._selectedPart) { - this._preFetchPart = this._selectedPart; - this._preFetchBorder = null; - } } }, diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index 7623f7cd8..d9ff748a3 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -1185,6 +1185,7 @@ L.GridLayer = L.Layer.extend({ var zoom = this._map.getZoom(); var tilesToFetch = 10; var maxBorderWidth = 5; + var tileBorderSrc; if (this._map._permission === 'edit') { tilesToFetch = 5; @@ -1192,19 +1193,17 @@ L.GridLayer = L.Layer.extend({ } if (!this._preFetchBorder) { - if (this._selectedPart !== this._preFetchPart) { - // all tiles from the new part have to be pre-fetched - var tileBorder = this._preFetchBorder = new L.Bounds(new L.Point(0, 0), new L.Point(0, 0)); - } - else { - var pixelBounds = this._map.getPixelBounds(center, zoom); - tileBorder = this._pxBoundsToTileRange(pixelBounds); - this._preFetchBorder = tileBorder; - } + var pixelBounds = this._map.getPixelBounds(center, zoom); + tileBorderSrc = this._pxBoundsToTileRange(pixelBounds); + this._preFetchBorder = tileBorderSrc; } else { - tileBorder = this._preFetchBorder; + tileBorderSrc = this._preFetchBorder; } + + // We mutate this - so need a temporary copy + var tileBorder = new L.Bounds(tileBorderSrc.min, tileBorderSrc.max); + var queue = [], finalQueue = [], visitedTiles = {}, diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index 787411afb..485343cd1 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -633,7 +633,6 @@ L.ImpressTileLayer = L.TileLayer.extend({ } else { // tile outside of the visible area, just remove it - this._preFetchBorder = null; this._removeTile(key); } } @@ -708,10 +707,6 @@ L.ImpressTileLayer = L.TileLayer.extend({ this._selectedParts = command.selectedParts || [command.selectedPart]; this._resetPreFetching(true); this._update(); - if (this._preFetchPart !== this._selectedPart) { - this._preFetchPart = this._selectedPart; - this._preFetchBorder = null; - } var partMatch = textMsg.match(/[^\r\n]+/g); // only get the last matches this._partHashes = partMatch.slice(partMatch.length - this._parts); diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js index 8b42c775b..c2c4f7850 100644 --- a/loleaflet/src/layer/tile/WriterTileLayer.js +++ b/loleaflet/src/layer/tile/WriterTileLayer.js @@ -294,7 +294,6 @@ L.WriterTileLayer = L.TileLayer.extend({ } else { // tile outside of the visible area, just remove it - this._preFetchBorder = null; this._removeTile(key); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits