[gnome-taquin/arnaudb/wip/gtk4: 4/56] Adapt EventController stuff.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-taquin/arnaudb/wip/gtk4: 4/56] Adapt EventController stuff.
- Date: Wed, 30 Sep 2020 13:55:32 +0000 (UTC)
commit 4af210ab6b43ae66c289a29bd83e11d545e80097
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Feb 19 19:06:30 2020 +0100
Adapt EventController stuff.
src/base-window.vala | 6 ++++--
src/taquin-view.vala | 10 ++++++----
2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/base-window.vala b/src/base-window.vala
index 2c652ab..5df3323 100644
--- a/src/base-window.vala
+++ b/src/base-window.vala
@@ -315,8 +315,9 @@ private class BaseWindow : AdaptativeWindow, AdaptativeWidget
private void init_keyboard () // called on construct
{
- key_controller = new Gtk.EventControllerKey (this);
+ key_controller = new Gtk.EventControllerKey ();
key_controller.key_pressed.connect (on_key_pressed);
+ add_controller (key_controller);
}
protected inline bool on_key_pressed (Gtk.EventControllerKey _key_controller, uint keyval, uint keycode,
Gdk.ModifierType state)
@@ -441,8 +442,9 @@ private class BaseWindow : AdaptativeWindow, AdaptativeWidget
{
create_about_dialog ();
about_dialog.response.connect ((_about_dialog, response) => _about_dialog.hide ());
- about_dialog_key_controller = new Gtk.EventControllerKey (about_dialog);
+ about_dialog_key_controller = new Gtk.EventControllerKey ();
about_dialog_key_controller.key_pressed.connect (on_about_dialog_key_pressed);
+ about_dialog.add_controller (about_dialog_key_controller);
about_dialog.set_transient_for (this);
should_init_about_dialog = false;
}
diff --git a/src/taquin-view.vala b/src/taquin-view.vala
index ebcda62..a881993 100644
--- a/src/taquin-view.vala
+++ b/src/taquin-view.vala
@@ -475,16 +475,17 @@ private class TaquinView : Gtk.DrawingArea
* * mouse user actions
\*/
- private Gtk.GestureMultiPress click_controller; // for keeping in memory
+ private Gtk.GestureClick click_controller; // for keeping in memory
private void init_mouse () // called on construct
{
- click_controller = new Gtk.GestureMultiPress (this);
+ click_controller = new Gtk.GestureClick ();
click_controller.set_button (/* all buttons */ 0);
click_controller.pressed.connect (on_click);
+ add_controller (click_controller);
}
- private inline void on_click (Gtk.GestureMultiPress _click_controller, int n_press, double event_x,
double event_y)
+ private inline void on_click (Gtk.GestureClick _click_controller, int n_press, double event_x, double
event_y)
{
if (finished || animate || animate_end)
return;
@@ -507,8 +508,9 @@ private class TaquinView : Gtk.DrawingArea
private void init_keyboard () // called on construct
{
- key_controller = new Gtk.EventControllerKey (this);
+ key_controller = new Gtk.EventControllerKey ();
key_controller.key_pressed.connect (on_key_pressed);
+ add_controller (key_controller);
}
private inline bool on_key_pressed (Gtk.EventControllerKey _key_controller, uint keyval, uint keycode,
Gdk.ModifierType state)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]