[gnome-music/wip/jfelder/gtk4-v3: 23/145] window: Fix EventController for GTK4




commit 35d94d48fc16f0058305a2ea347de9dc7455d67e
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Apr 11 20:34:47 2021 +0200

    window: Fix EventController for GTK4

 data/ui/Window.ui    | 10 +++++-----
 gnomemusic/window.py |  1 -
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/Window.ui b/data/ui/Window.ui
index 91892b5d9..09c740bcf 100644
--- a/data/ui/Window.ui
+++ b/data/ui/Window.ui
@@ -3,6 +3,11 @@
   <template class="Window" parent="AdwApplicationWindow">
     <property name="default-height">500</property>
     <property name="default-width">300</property>
+    <child>
+      <object class="GtkEventControllerKey">
+        <signal name="key-pressed" handler="_on_key_press" swapped="no"/>
+      </object>
+    </child>
     <child>
       <object class="GtkBox">
         <property name="orientation">vertical</property>
@@ -45,9 +50,4 @@
       </object>
     </child>
   </template>
-  <object class="GtkEventControllerKey" id="_key_controller">
-    <property name="widget">Window</property>
-    <property name="propagation-phase">capture</property>
-    <signal name="key-pressed" handler="_on_key_press" swapped="no"/>
-  </object>
 </interface>
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index e257b332e..23779b3c3 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -58,7 +58,6 @@ class Window(Adw.ApplicationWindow):
 
     notifications_popup = Gtk.Template.Child()
     _headerbar_stack = Gtk.Template.Child()
-    _key_controller = Gtk.Template.Child()
     _overlay = Gtk.Template.Child()
     _player_toolbar = Gtk.Template.Child()
     _selection_toolbar = Gtk.Template.Child()


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