[gnome-maps] mainWindow: Partly fix some animation glitches



commit d558cf5143932d97fb8321cfdfe8db714d81961d
Author: James Westman <james flyingpimonster net>
Date:   Thu Jul 30 17:38:05 2020 -0500

    mainWindow: Partly fix some animation glitches
    
    These glitches are caused by the combination of HdyLeaflet and GtkRevealer
    both animating at the same (and sometimes different) times. The revealer might
    be part way through expanding before the leaflet decides it needs to fold, and
    the same when unfolding.
    
    Partly fixed by checking the widths of the leaflet's children, to predict
    whether it will need to fold. This makes sure the headerbar animation is synced
    with the leaflet's, but does not fix the other glitches.
    
    A more robust fix would be to look into HdyFlap, but that has not yet been
    merged into libhandy.

 src/mainWindow.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index c131ecb4..26aeb27a 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -581,7 +581,9 @@ var MainWindow = GObject.registerClass({
     }
 
     _updateRoutingHeaderBar() {
-        let folded = this._leaflet.folded;
+        let [sidebarMin, _] = this._sidebar.get_child().get_preferred_width();
+        let [mainMin, _1] = this._mainBox.get_preferred_width();
+        let folded = this._leaflet.folded || sidebarMin + mainMin > this.get_allocated_width();
         let sidebarVisible = this._leaflet.visible_child == this._sidebar;
 
         if (folded && sidebarVisible) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]