[gnome-mines/arnaudb/wip/gtk4: 33/36] Fix playing with mouse.



commit fe7635297c5741a7af2e1ba0d1df075a5cd63723
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 82151c4..edb8c04 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,14 +22,14 @@ public class Tile : Gtk.Button
     {
         add_css_class ("tile");
 
-        _gesture = new Gtk.GestureLongPress ();
+        _gesture = new GestureLongPress ();
         _gesture.pressed.connect((x, y) =>
         {
             tile_long_pressed (row, column);
         });
         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]