From 28816052af02e1fa61d06806bf366be33d4b4b6a Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 15 Jul 2020 23:24:55 +0200 Subject: android: Hide sidebar on Chromebooks early. This is a hack - but I fear the best we can do just now. The problem is that the sidebar is always initialized at the startup, just for mobile phones and tablets, we don't show it thanks to an early exit in _launchSidebar() when the app starts in read-only mode (which it does for phones and tablets). Now when we have switched the Chromebook UI to the desktop one, we need to explicitly turn the sidebar off on start, because otherwise it occupies too much screen. Of course - much better would be not to initialize the sidebar at all when it is not necessary - but there's no easy way to do that :-( Change-Id: I0340d125181285dcebda4ff78971182a7072dddb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98862 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky --- loleaflet/src/map/Map.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 5f9882a53d..0368915e3e 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -304,6 +304,16 @@ L.Map = L.Evented.extend({ if (window.mode.isDesktop() && !window.ThisIsAMobileApp) { map._socket.sendMessage('uno .uno:SidebarShow'); } + else if (window.mode.isChromebook()) { + // HACK - currently the sidebar shows when loaded, + // with the exception of mobile phones & tablets - but + // there, it does not show only because they start + // with read/only mode which hits an early exit in + // _launchSidebar() in Control.LokDialog.js + // So for the moment, let's just hide it on + // Chromebooks early + map._socket.sendMessage('uno .uno:SidebarHide'); + } }, 200); } -- cgit