[five-or-more/arnaudb/wip/gtk4: 19/37] Update to GestureClick.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [five-or-more/arnaudb/wip/gtk4: 19/37] Update to GestureClick.
- Date: Tue, 4 Aug 2020 15:17:06 +0000 (UTC)
commit b602c67981b0d49626af7926713d6abe98f7c1e8
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Mar 12 21:27:01 2020 +0100
Update to GestureClick.
And other EventController things.
src/view.vala | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/view.vala b/src/view.vala
index 21ce61a..379a727 100644
--- a/src/view.vala
+++ b/src/view.vala
@@ -51,7 +51,7 @@ private class View : DrawingArea
private uint animation_id;
private EventControllerKey key_controller; // for keeping in memory
- private GestureMultiPress click_controller; // for keeping in memory
+ private GestureClick click_controller; // for keeping in memory
internal const string default_background_color = "rgb(117,144,174)";
private string _background_color = default_background_color;
@@ -168,8 +168,9 @@ private class View : DrawingArea
private void init_keyboard ()
{
- 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)
@@ -293,11 +294,12 @@ private class View : DrawingArea
private void init_mouse ()
{
- click_controller = new GestureMultiPress (this); // only reacts to Gdk.BUTTON_PRIMARY
+ click_controller = new GestureClick (); // only reacts to Gdk.BUTTON_PRIMARY
click_controller.pressed.connect (on_click);
+ add_controller (click_controller);
}
- private inline void on_click (GestureMultiPress _click_controller, int n_press, double event_x, double
event_y)
+ private inline void on_click (GestureClick _click_controller, int n_press, double event_x, double
event_y)
{
if (game == null || game.animating)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]