[gnome-taquin/arnaudb/wip/gtk4: 10/43] Adapt to MenuButton API.



commit b7b1b419b322f9744537c25f97ff671aa1825340
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Feb 19 21:52:13 2020 +0100

    Adapt to MenuButton API.

 src/base-headerbar.vala | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/base-headerbar.vala b/src/base-headerbar.vala
index a536635..4d6bc5a 100644
--- a/src/base-headerbar.vala
+++ b/src/base-headerbar.vala
@@ -132,16 +132,17 @@ private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
 
     protected inline void hide_hamburger_menu ()
     {
-        if (info_button.active)
-            info_button.active = false;
+        info_button.popdown ();
     }
 
     internal void toggle_hamburger_menu ()
     {
-        if (info_button.visible)
-            info_button.active = !info_button.active;
-        else
+        if (!info_button.visible)
             toggle_view_menu ();
+        else if (info_button.popover.visible)   // TODO hackish 1/2
+            info_button.popdown ();
+        else
+            info_button.popup ();
     }
     protected virtual void toggle_view_menu () {}
 
@@ -304,6 +305,6 @@ private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
 
     internal virtual bool has_popover ()
     {
-        return info_button.active;
+        return info_button.popover.visible;     // TODO hackish 2/2
     }
 }


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