[gnome-system-log] filter-manager: port GtkTable -> GtkGrid
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-log] filter-manager: port GtkTable -> GtkGrid
- Date: Tue, 25 Oct 2011 15:41:50 +0000 (UTC)
commit 58edf0b441e11bfbe5182a20e61803dd5b334e69
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Oct 25 11:37:18 2011 -0400
filter-manager: port GtkTable -> GtkGrid
src/logview-filter-manager.c | 43 +++++++++++++++++++++++++++--------------
1 files changed, 28 insertions(+), 15 deletions(-)
---
diff --git a/src/logview-filter-manager.c b/src/logview-filter-manager.c
index 68247aa..3b5fa50 100644
--- a/src/logview-filter-manager.c
+++ b/src/logview-filter-manager.c
@@ -452,7 +452,7 @@ on_tree_selection_changed (GtkTreeSelection *selection, LogviewFilterManager *ma
static void
logview_filter_manager_init (LogviewFilterManager *manager)
{
- GtkWidget *table;
+ GtkWidget *grid;
GtkWidget *scrolled_window;
GtkTreeViewColumn *column;
GtkCellRenderer *text_renderer;
@@ -476,7 +476,9 @@ logview_filter_manager_init (LogviewFilterManager *manager)
G_TYPE_OBJECT));
logview_filter_manager_update_model (manager);
- table = gtk_table_new (3, 2, FALSE);
+ grid = gtk_grid_new ();
+ gtk_container_set_border_width (GTK_CONTAINER (grid), 5);
+
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -519,20 +521,31 @@ logview_filter_manager_init (LogviewFilterManager *manager)
"changed", G_CALLBACK (on_tree_selection_changed),
manager);
- gtk_table_attach_defaults (GTK_TABLE (table),
- scrolled_window,
- 0, 1, 0, 3);
- gtk_table_attach (GTK_TABLE (table),
- priv->add_button,
- 1, 2, 0, 1, GTK_FILL, 0, 5, 5);
- gtk_table_attach (GTK_TABLE (table),
- priv->edit_button,
- 1, 2, 1, 2, GTK_FILL, 0, 5, 5);
- gtk_table_attach (GTK_TABLE (table),
- priv->remove_button,
- 1, 2, 2, 3, GTK_FILL, 0, 5, 5);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 10);
+
+ gtk_widget_set_hexpand (scrolled_window, TRUE);
+ gtk_widget_set_vexpand (scrolled_window, TRUE);
+ gtk_grid_attach (GTK_GRID (grid), scrolled_window,
+ 0, 0, 1, 3);
+
+ gtk_widget_set_valign (priv->add_button,
+ GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (priv->edit_button,
+ GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (priv->remove_button,
+ GTK_ALIGN_CENTER);
+
+ gtk_grid_attach (GTK_GRID (grid), priv->add_button,
+ 1, 0, 1, 1);
+ gtk_grid_attach_next_to (GTK_GRID (grid), priv->edit_button,
+ priv->add_button, GTK_POS_BOTTOM,
+ 1, 1);
+ gtk_grid_attach_next_to (GTK_GRID (grid), priv->remove_button,
+ priv->edit_button, GTK_POS_BOTTOM,
+ 1, 1);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (manager))),
- table, TRUE, TRUE, 5);
+ grid, TRUE, TRUE, 5);
gtk_widget_show_all (GTK_WIDGET (manager));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]