[gnome-games] mahjongg: Tidy up statusbar patch, remove tile count label, fix whitespace, remove tooltip code, rig



commit 997324727db152ef552c6ef7c0833e4197f44d2c
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Dec 26 14:02:28 2011 +1100

    mahjongg: Tidy up statusbar patch, remove tile count label, fix whitespace, remove tooltip code, right align clock

 mahjongg/src/mahjongg.vala |   34 ++++++++++------------------------
 1 files changed, 10 insertions(+), 24 deletions(-)
---
diff --git a/mahjongg/src/mahjongg.vala b/mahjongg/src/mahjongg.vala
index 22d9457..36045ef 100644
--- a/mahjongg/src/mahjongg.vala
+++ b/mahjongg/src/mahjongg.vala
@@ -10,7 +10,6 @@ public class Mahjongg : Gtk.Application
     private GameView game_view;
     private Gtk.ToolItem status_item;
     private Gtk.UIManager ui_manager;
-    private Gtk.Label tiles_label;
     private Gtk.Toolbar toolbar;
     private Gtk.Label moves_label;
     private GnomeGamesSupport.Clock game_clock;
@@ -51,19 +50,10 @@ public class Mahjongg : Gtk.Application
         var status_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 10);
 
         var group_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
-        var label = new Gtk.Label (_("Tiles Left:"));
+        var label = new Gtk.Label (_("Moves Left:"));
         group_box.pack_start (label, false, false, 0);
         var spacer = new Gtk.Label (" ");
         group_box.pack_start (spacer, false, false, 0);
-        tiles_label = new Gtk.Label ("");
-        group_box.pack_start (tiles_label, false, false, 0);
-        status_box.pack_start (group_box, false, false, 0);
-
-        group_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
-        label = new Gtk.Label (_("Moves Left:"));
-        group_box.pack_start (label, false, false, 0);
-        spacer = new Gtk.Label (" ");
-        group_box.pack_start (spacer, false, false, 0);
         moves_label = new Gtk.Label ("");
         group_box.pack_start (moves_label, false, false, 0);
         status_box.pack_start (group_box, false, false, 0);
@@ -78,7 +68,7 @@ public class Mahjongg : Gtk.Application
         status_box.pack_start (group_box, false, false, 0);
         
         var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
-        
+
         ui_manager = new Gtk.UIManager ();
 
         create_menus (ui_manager);
@@ -87,22 +77,19 @@ public class Mahjongg : Gtk.Application
 
         game_view = new GameView ();
         game_view.button_press_event.connect (view_button_press_event);        
-        game_view.set_size_request (600, 200);
+        game_view.set_size_request (600, 400);
 
         toolbar = (Gtk.Toolbar) ui_manager.get_widget ("/Toolbar");
         toolbar.get_style_context ().add_class (Gtk.STYLE_CLASS_PRIMARY_TOOLBAR);
-        
-        toolbar.insert(new Gtk.SeparatorToolItem(),-1);
+
+        var status_alignment = new Gtk.Alignment (1.0f, 0.5f, 0.0f, 0.0f);
+        status_alignment.add (status_box);
 
         status_item = new Gtk.ToolItem ();
-        status_item.add (status_box);
-        status_item.set_visible_horizontal(true);
-        
-        toolbar.insert (status_item,-1);
-        
-        
-        var virtual_statusbar = new Gtk.Statusbar ();
-        GnomeGamesSupport.stock_prepare_for_statusbar_tooltips (ui_manager, virtual_statusbar);
+        status_item.set_expand (true);
+        status_item.add (status_alignment);
+
+        toolbar.insert (status_item, -1);
 
         vbox.pack_start (box, false, false, 0);
         vbox.pack_start (toolbar, false, false, 0);
@@ -151,7 +138,6 @@ public class Mahjongg : Gtk.Application
         }
 
         moves_label.set_text ("%2u".printf (game_view.game.moves_left));
-        tiles_label.set_text ("%3d".printf (game_view.game.visible_tiles));
     }
 
     private void theme_changed_cb (Gtk.ComboBox widget)



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