[gnome-mines/gnome-3-18] Improved keyboard cursor display and behaviour



commit e908c2bb4fa78efe8b146782cbe44dca9a0b141e
Author: Isaac Lenton <isaac isuniversal com>
Date:   Sat Oct 31 12:08:05 2015 +1000

    Improved keyboard cursor display and behaviour
    
        - Control (used for adding flags) no longer hides keyboard cursor.
        - Mouse cursor no longer obscures keyboard cursor.
    
        https://bugzilla.gnome.org/show_bug.cgi?id=757405

 data/gnome-mines.css    |    4 ++--
 src/minefield-view.vala |   10 +++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/data/gnome-mines.css b/data/gnome-mines.css
index d31caec..f84b65f 100644
--- a/data/gnome-mines.css
+++ b/data/gnome-mines.css
@@ -41,7 +41,7 @@
   border-width:2px;
 }
 
-.tile:hover {
+.tile:not(.cursor):hover {
   background-color:#d3d7cf;
   transition-duration:0.4s;
 }
@@ -60,7 +60,7 @@
   transition-duration:0.4s;
 }
 
-.count:hover {
+.count:not(.cursor):hover {
   background-color:#dededc;
 }
 
diff --git a/src/minefield-view.vala b/src/minefield-view.vala
index 39ff817..91c627e 100644
--- a/src/minefield-view.vala
+++ b/src/minefield-view.vala
@@ -503,8 +503,16 @@ public class MinefieldView : Gtk.Grid
             }
             break;
 
-        default:
+        /* Unset the keyboard cursor. */
+        case Gdk.Key.Escape:
             return false;
+
+        /* Ignore other keyboard keys but don't unset the cursor. */
+        default:
+            if (keyboard_cursor.is_set)
+                break;
+            else
+                return false;
         }
 
         if (x == keyboard_cursor.x && y == keyboard_cursor.y)


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