gnome-games r7164 - trunk/aisleriot



Author: chpe
Date: Sun Jan 13 22:07:21 2008
New Revision: 7164
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7164&view=rev

Log:
Handle the focus slot changing from no cards to having cards (e.g. when
using control-activate an empty foundation slot moving some cards to
that slot) by focusing the topmost card instead of keeping the focus on
the slot itself (-1).


Modified:
   trunk/aisleriot/board.c

Modified: trunk/aisleriot/board.c
==============================================================================
--- trunk/aisleriot/board.c	(original)
+++ trunk/aisleriot/board.c	Sun Jan 13 22:07:21 2008
@@ -1976,8 +1976,14 @@
     /* Try to keep the focus intact. If the focused card isn't there
      * anymore, this will set the focus to the topmost card of there
      * same slot, or the slot itself if there are no cards on it.
+     * If the slot was empty but now isn't, we set the focus to the
+     * topmost card.
      */
-    set_focus (board, slot, priv->focus_card_id, priv->show_focus);
+    if (priv->focus_card_id < 0) {
+      set_focus (board, slot, ((int) slot->cards->len) - 1, priv->show_focus);
+    } else {
+      set_focus (board, slot, priv->focus_card_id, priv->show_focus);
+    }
   }
   if (slot == priv->highlight_slot) {
     highlight_drop_target (board, NULL);



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