[shotwell/wip/gtk4: 139/154] Fix keypress handling in child classes of Page




commit 6b3517cb89b103afc9e7ae2bbe60b83b402522b8
Author: Jens Georg <mail jensge org>
Date:   Fri Apr 22 08:47:44 2022 +0200

    Fix keypress handling in child classes of Page

 src/PhotoPage.vala     | 12 +++---------
 src/SlideshowPage.vala |  2 +-
 2 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/PhotoPage.vala b/src/PhotoPage.vala
index 9f63f8e0..e63031cc 100644
--- a/src/PhotoPage.vala
+++ b/src/PhotoPage.vala
@@ -2331,10 +2331,6 @@ public class LibraryPhotoPage : EditingHostPage {
         get_view().install_view_filter(filter);
         LibraryPhoto.global.items_unlinking.connect(on_photo_unlinking);
         LibraryPhoto.global.items_relinked.connect(on_photo_relinked);
-
-        var key = new Gtk.EventControllerKey();
-        key.key_pressed.connect(key_press_event);
-        add_controller(key);
     }
     
     ~LibraryPhotoPage() {
@@ -2708,12 +2704,10 @@ public class LibraryPhotoPage : EditingHostPage {
         base.notify_photo_backing_missing(photo, missing);
     }
     
-    public bool key_press_event(Gtk.EventControllerKey event, uint keyval, uint keycode, Gdk.ModifierType 
modifiers) {
-        #if 0
-        if (base.key_press_event != null && base.key_press_event(event) == true)
+    public override bool key_press_event(Gtk.EventControllerKey event, uint keyval, uint keycode, 
Gdk.ModifierType modifiers) {
+        if (base.key_press_event(event, keyval, keycode, modifiers))
             return true;
-        #endif
-        
+
         bool handled = true;
         string? format = null;
         switch (Gdk.keyval_name(keyval)) {
diff --git a/src/SlideshowPage.vala b/src/SlideshowPage.vala
index ab68b918..86589bb3 100644
--- a/src/SlideshowPage.vala
+++ b/src/SlideshowPage.vala
@@ -336,7 +336,7 @@ class SlideshowPage : SinglePhotoPage {
         return true;
     }
     
-    public bool key_press_event(Gtk.EventControllerKey event, uint keyval, uint keycode, Gdk.ModifierType 
modifiers) {
+    public override bool key_press_event(Gtk.EventControllerKey event, uint keyval, uint keycode, 
Gdk.ModifierType modifiers) {
         bool handled = true;
         switch (Gdk.keyval_name(keyval)) {
             // Block activating the toolbar on key down


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