[gnome-mines/arnaudb/wip/gtk4: 28/39] Fix playing with mouse.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mines/arnaudb/wip/gtk4: 28/39] Fix playing with mouse.
- Date: Sat, 26 Sep 2020 10:14:09 +0000 (UTC)
commit 37d36b37a31c2165522e9bf2badb3c3581beb3ae
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Apr 16 16:18:03 2020 +0200
Fix playing with mouse.
src/gnome-mines.css | 5 +++++
src/tile.vala | 12 +++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-mines.css b/src/gnome-mines.css
index 7ae95f8..14a0246 100644
--- a/src/gnome-mines.css
+++ b/src/gnome-mines.css
@@ -40,6 +40,11 @@
background-repeat: no-repeat;
box-shadow:none;
border-width:2px;
+ min-height:24px;
+ min-width:24px;
+ border-style:solid;
+ -gtk-icon-shadow:none;
+ -gtk-icon-filter:none;
}
.tile:not(.cursor):hover {
diff --git a/src/tile.vala b/src/tile.vala
index 71c43ce..c9d64d8 100644
--- a/src/tile.vala
+++ b/src/tile.vala
@@ -1,10 +1,12 @@
-public class Tile : Gtk.Button
+using Gtk;
+
+public class Tile : Widget
{
public int row { internal get; protected construct; }
public int column { internal get; protected construct; }
- private Gtk.GestureLongPress _gesture; // for keeping in memory
- private Gtk.GestureClick _click_controller; // for keeping in memory
+ private GestureLongPress _gesture; // for keeping in memory
+ private GestureClick _click_controller; // for keeping in memory
public signal void tile_mouse_over (int x, int y);
public signal void tile_pressed (int x, int y, uint button, int n_press, bool ctrl);
@@ -20,7 +22,7 @@ public class Tile : Gtk.Button
{
add_css_class ("tile");
- _gesture = new Gtk.GestureLongPress ();
+ _gesture = new GestureLongPress ();
_gesture.touch_only = true;
_gesture.pressed.connect((x, y) =>
{
@@ -28,7 +30,7 @@ public class Tile : Gtk.Button
});
add_controller (_gesture);
- _click_controller = new Gtk.GestureClick ();
+ _click_controller = new GestureClick ();
_click_controller.set_button (/* all buttons */ 0);
_click_controller.pressed.connect ((click_controller, n_press, x, y) =>
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]