[gnome-games] mahjongg: replace GtkTable with GtkGrid
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] mahjongg: replace GtkTable with GtkGrid
- Date: Thu, 29 Dec 2011 00:48:20 +0000 (UTC)
commit 379612332b62d0f11acca4f7016a78692a80b573
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date: Thu Dec 29 01:48:13 2011 +0100
mahjongg: replace GtkTable with GtkGrid
mahjongg/src/mahjongg.vala | 55 +++++++++++++++++++++++--------------------
1 files changed, 29 insertions(+), 26 deletions(-)
---
diff --git a/mahjongg/src/mahjongg.vala b/mahjongg/src/mahjongg.vala
index 36045ef..ee99f3d 100644
--- a/mahjongg/src/mahjongg.vala
+++ b/mahjongg/src/mahjongg.vala
@@ -327,21 +327,21 @@ public class Mahjongg : Gtk.Application
preferences_dialog.set_default_response (Gtk.ResponseType.CLOSE);
preferences_dialog.response.connect (preferences_dialog_response_cb);
- var top_table = new Gtk.Table (4, 1, false);
- top_table.border_width = 5;
- top_table.set_row_spacings (18);
- top_table.set_col_spacings (0);
+ var top_grid = new Gtk.Grid ();
+ top_grid.border_width = 5;
+ top_grid.set_row_spacing (18);
+ top_grid.set_column_spacing (0);
var frame = new GnomeGamesSupport.Frame (_("Tiles"));
- top_table.attach_defaults (frame, 0, 1, 0, 1);
+ top_grid.attach (frame, 0, 0, 1, 1);
- var table = new Gtk.Table (2, 2, false);
- table.set_row_spacings (6);
- table.set_col_spacings (12);
+ var grid = new Gtk.Grid ();
+ grid.set_row_spacing (6);
+ grid.set_column_spacing (12);
var label = new Gtk.Label.with_mnemonic (_("_Tile set:"));
label.set_alignment (0, 0.5f);
- table.attach (label, 0, 1, 0, 1, Gtk.AttachOptions.FILL, 0, 0, 0);
+ grid.attach (label, 0, 0, 1, 1);
var themes = load_themes ();
var theme_combo = new Gtk.ComboBox ();
@@ -363,21 +363,22 @@ public class Mahjongg : Gtk.Application
theme_combo.set_active_iter (iter);
}
theme_combo.changed.connect (theme_changed_cb);
- table.attach_defaults (theme_combo, 1, 2, 0, 1);
+ theme_combo.set_hexpand (true);
+ grid.attach (theme_combo, 1, 0, 1, 1);
label.set_mnemonic_widget (theme_combo);
- frame.add (table);
+ frame.add (grid);
frame = new GnomeGamesSupport.Frame (_("Maps"));
- top_table.attach_defaults (frame, 0, 1, 1, 2);
+ top_grid.attach (frame, 0, 1, 1, 1);
- table = new Gtk.Table (1, 2, false);
- table.set_row_spacings (6);
- table.set_col_spacings (12);
+ grid = new Gtk.Grid ();
+ grid.set_row_spacing (6);
+ grid.set_column_spacing (12);
label = new Gtk.Label.with_mnemonic (_("_Select map:"));
label.set_alignment (0, 0.5f);
- table.attach (label, 0, 1, 0, 1, Gtk.AttachOptions.FILL, 0, 0, 0);
+ grid.attach (label, 0, 0, 1, 1);
var map_combo = new Gtk.ComboBox ();
var map_store = new Gtk.ListStore (2, typeof (string), typeof (string));
@@ -397,31 +398,33 @@ public class Mahjongg : Gtk.Application
map_combo.set_active_iter (iter);
}
map_combo.changed.connect (map_changed_cb);
- table.attach_defaults (map_combo, 1, 2, 0, 1);
+ map_combo.set_hexpand (true);
+ grid.attach (map_combo, 1, 0, 1, 1);
label.set_mnemonic_widget (map_combo);
- frame.add (table);
+ frame.add (grid);
frame = new GnomeGamesSupport.Frame (_("Colors"));
- top_table.attach_defaults (frame, 0, 1, 2, 3);
+ top_grid.attach (frame, 0, 2, 1, 1);
- table = new Gtk.Table (1, 2, false);
- table.set_row_spacings (6);
- table.set_col_spacings (12);
+ grid = new Gtk.Grid ();
+ grid.set_row_spacing (6);
+ grid.set_column_spacing (12);
label = new Gtk.Label.with_mnemonic (_("_Background color:"));
label.set_alignment (0, 0.5f);
- table.attach (label, 0, 1, 0, 1, Gtk.AttachOptions.FILL, 0, 0, 0);
+ grid.attach (label, 0, 0, 1, 1);
var widget = new Gtk.ColorButton ();
widget.set_color (game_view.background_color);
widget.color_set.connect (background_changed_cb);
- table.attach_defaults (widget, 1, 2, 0, 1);
+ widget.set_hexpand (true);
+ grid.attach (widget, 1, 0, 1, 1);
label.set_mnemonic_widget (widget);
- frame.add (table);
+ frame.add (grid);
- dialog_content_area.pack_start (top_table, true, true, 0);
+ dialog_content_area.pack_start (top_grid, true, true, 0);
preferences_dialog.show_all ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]