Commit 0e4da586 authored by Tristan Van Berkom's avatar Tristan Van Berkom

* gladeui/glade-base-editor.c, gladeui/glade-editor-property.c,

	gladeui/glade-editor-table.c, gladeui/glade-editor-table.h,
	plugins/gtk+/glade-activatable-editor.c, plugins/gtk+/glade-button-editor.c,
	plugins/gtk+/glade-entry-editor.c, plugins/gtk+/glade-image-editor.c,
	plugins/gtk+/glade-image-item-editor.c, plugins/gtk+/glade-label-editor.c,
	plugins/gtk+/glade-label-editor.h, plugins/gtk+/glade-tool-button-editor.c:
	Removed the GtkTables and use GtkGrid in property editors so that line wrapping
	is hieght-for-width.
parent a334a9d2
2010-12-29 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-base-editor.c, gladeui/glade-editor-property.c,
gladeui/glade-editor-table.c, gladeui/glade-editor-table.h,
plugins/gtk+/glade-activatable-editor.c, plugins/gtk+/glade-button-editor.c,
plugins/gtk+/glade-entry-editor.c, plugins/gtk+/glade-image-editor.c,
plugins/gtk+/glade-image-item-editor.c, plugins/gtk+/glade-label-editor.c,
plugins/gtk+/glade-label-editor.h, plugins/gtk+/glade-tool-button-editor.c:
Removed the GtkTables and use GtkGrid in property editors so that line wrapping
is hieght-for-width.
2010-12-28 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/Makefile.am, gladeui/glade.h, gladeui/glade-clipboard.c, gladeui/glade-app.[ch],
......
......@@ -68,7 +68,6 @@ struct _GladeBaseEditorPrivate
GladeWidget *gcontainer; /* The container we are editing */
/* Editor UI */
GtkSizeGroup *group;
GtkWidget *paned, *table, *treeview, *main_scroll, *notebook;
GtkWidget *remove_button;
GladeSignalEditor *signal_editor;
......@@ -376,24 +375,20 @@ glade_base_editor_table_attach (GladeBaseEditor *e,
GtkWidget *child1,
GtkWidget *child2)
{
GtkTable *table = GTK_TABLE (e->priv->table);
GtkGrid *table = GTK_GRID (e->priv->table);
gint row = e->priv->row;
if (child1)
{
gtk_table_attach (table, child1, 0, 1, row, row + 1,
GTK_EXPAND | GTK_FILL, GTK_FILL, 2, 0);
gtk_grid_attach (table, child1, 0, row, 1, 1);
gtk_widget_set_hexpand (child1, TRUE);
gtk_widget_show (child1);
}
if (child2)
{
gtk_table_attach (table, child2, 1, 2, row, row + 1,
0, GTK_FILL, 2, 0);
gtk_grid_attach (table, child2, 1, row, 1, 1);
gtk_widget_show (child2);
gtk_size_group_add_widget (e->priv->group, child2);
}
e->priv->row++;
......@@ -1272,10 +1267,6 @@ glade_base_editor_dispose (GObject *object)
glade_base_editor_project_disconnect (cobj);
cobj->priv->project = NULL;
if (cobj->priv->group)
cobj->priv->group =
(g_object_unref (cobj->priv->group), NULL);
G_OBJECT_CLASS(parent_class)->dispose (object);
}
......@@ -1682,8 +1673,6 @@ glade_base_editor_init (GladeBaseEditor *editor)
gtk_box_set_spacing (GTK_BOX (editor), 8);
e = editor->priv = g_new0(GladeBaseEditorPrivate, 1);
e->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Paned */
e->paned = paned = gtk_vpaned_new ();
......@@ -1797,9 +1786,11 @@ glade_base_editor_init (GladeBaseEditor *editor)
gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
/* Tables */
e->table = gtk_table_new (1, 2, FALSE);
e->table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (e->table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_column_spacing (GTK_GRID (e->table), 4);
gtk_grid_set_row_spacing (GTK_GRID (e->table), 4);
gtk_widget_show (e->table);
gtk_table_set_row_spacings (GTK_TABLE (e->table), 4);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll), e->table);
/* Signal Editor */
......@@ -2110,8 +2101,9 @@ glade_base_editor_add_editable (GladeBaseEditor *editor,
gtk_widget_show (GTK_WIDGET (editable));
row = editor->priv->row;
gtk_table_attach (GTK_TABLE (editor->priv->table), GTK_WIDGET (editable), 0, 2, row, row + 1,
GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 0);
gtk_grid_attach (GTK_GRID (editor->priv->table), GTK_WIDGET (editable), 0, row, 2, 1);
gtk_widget_set_hexpand (GTK_WIDGET (editable), TRUE);
editor->priv->row++;
......@@ -2145,8 +2137,8 @@ glade_base_editor_add_label (GladeBaseEditor *editor, gchar *str)
gtk_label_set_markup (GTK_LABEL (label), markup);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_misc_set_padding (GTK_MISC (label), 0, 6);
gtk_table_attach (GTK_TABLE (editor->priv->table), label, 0, 2, row, row + 1,
GTK_FILL, GTK_FILL, 2, 0);
gtk_grid_attach (GTK_GRID (editor->priv->table), label, 0, row, 2, 1);
gtk_widget_show (label);
editor->priv->row++;
......
......@@ -285,11 +285,11 @@ glade_editor_property_constructor (GType type,
hbox = gtk_hbox_new (FALSE, 4);
gtk_label_set_line_wrap (GTK_LABEL(eprop->label), TRUE);
gtk_label_set_width_chars (GTK_LABEL(eprop->label), 10);
gtk_label_set_line_wrap_mode (GTK_LABEL(eprop->label), PANGO_WRAP_WORD_CHAR);
gtk_label_set_line_wrap (GTK_LABEL (eprop->label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (eprop->label), 10);
gtk_label_set_line_wrap_mode (GTK_LABEL (eprop->label), PANGO_WRAP_WORD_CHAR);
gtk_misc_set_alignment (GTK_MISC(eprop->label), 0.0, 0.5);
gtk_misc_set_alignment (GTK_MISC (eprop->label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), eprop->label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), eprop->warning, FALSE, FALSE, 0);
......
......@@ -33,7 +33,7 @@ static void glade_editor_table_editable_init (GladeEditableIface *i
static void glade_editor_table_realize (GtkWidget *widget);
static void glade_editor_table_grab_focus (GtkWidget *widget);
G_DEFINE_TYPE_WITH_CODE (GladeEditorTable, glade_editor_table, GTK_TYPE_TABLE,
G_DEFINE_TYPE_WITH_CODE (GladeEditorTable, glade_editor_table, GTK_TYPE_GRID,
G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
glade_editor_table_editable_init));
......@@ -65,7 +65,8 @@ glade_editor_table_class_init (GladeEditorTableClass *klass)
static void
glade_editor_table_init (GladeEditorTable *self)
{
self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (self), 4);
}
static void
......@@ -83,10 +84,6 @@ glade_editor_table_dispose (GObject *object)
glade_editable_load (GLADE_EDITABLE (table), NULL);
if (table->group)
g_object_unref (table->group);
table->group = NULL;
G_OBJECT_CLASS (glade_editor_table_parent_class)->dispose (object);
}
......@@ -259,15 +256,11 @@ glade_editor_table_attach (GladeEditorTable *table,
GtkWidget *child,
gint pos, gint row)
{
gtk_table_attach (GTK_TABLE (table), child,
pos, pos+1, row, row +1,
pos ? 0 : GTK_EXPAND | GTK_FILL,
0,
3, 1);
if (pos)
gtk_size_group_add_widget (table->group, child);
gtk_grid_attach (GTK_GRID (table), child,
pos, row, 1, 1);
if (pos)
gtk_widget_set_hexpand (child, TRUE);
}
static gint
......
......@@ -40,7 +40,7 @@ typedef struct _GladeEditorTableClass GladeEditorTableClass;
struct _GladeEditorTable
{
GtkTable parent;
GtkGrid parent;
GladeWidgetAdaptor *adaptor; /* The GladeWidgetAdaptor this
* table was created for.
......@@ -48,8 +48,6 @@ struct _GladeEditorTable
GladeWidget *loaded_widget; /* A pointer to the currently loaded GladeWidget
*/
GtkSizeGroup *group; /* Group of editing widgets in the right hand column */
GtkWidget *name_label; /* A pointer to the "Name:" label (for show/hide) */
GtkWidget *name_entry; /* A pointer to the gtk_entry that holds
......@@ -74,7 +72,7 @@ struct _GladeEditorTable
struct _GladeEditorTableClass
{
GtkTableClass parent;
GtkGridClass parent;
};
GType glade_editor_table_get_type (void);
......
......@@ -172,17 +172,13 @@ glade_activatable_editor_grab_focus (GtkWidget *widget)
static void
table_attach (GtkWidget *table,
GtkWidget *child,
gint pos, gint row,
GtkSizeGroup *group)
gint pos, gint row)
{
gtk_table_attach (GTK_TABLE (table), child,
pos, pos+1, row, row +1,
pos ? 0 : GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL,
3, 1);
gtk_grid_attach (GTK_GRID (table), child,
pos, row, 1, 1);
if (pos)
gtk_size_group_add_widget (group, child);
gtk_widget_set_hexpand (child, TRUE);
}
static void
......@@ -379,7 +375,6 @@ glade_activatable_editor_new (GladeWidgetAdaptor *adaptor,
GladeActivatableEditor *activatable_editor;
GladeEditorProperty *eprop;
GtkWidget *table, *frame, *alignment, *label;
GtkSizeGroup *group;
gchar *str;
gint row = 0;
......@@ -405,14 +400,15 @@ glade_activatable_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), alignment);
table = gtk_table_new (0, 0, FALSE);
gtk_container_add (GTK_CONTAINER (alignment), table);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (alignment), table);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "related-action", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, row, group);
table_attach (table, GTK_WIDGET (eprop), 1, row++, group);
table_attach (table, eprop->item_label, 0, row);
table_attach (table, GTK_WIDGET (eprop), 1, row++);
activatable_editor->properties = g_list_prepend (activatable_editor->properties, eprop);
g_signal_connect (G_OBJECT (eprop), "commit",
......@@ -421,8 +417,8 @@ glade_activatable_editor_new (GladeWidgetAdaptor *adaptor,
G_CALLBACK (related_action_post_commit), activatable_editor);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "use-action-appearance", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, row, group);
table_attach (table, GTK_WIDGET (eprop), 1, row++, group);
table_attach (table, eprop->item_label, 0, row);
table_attach (table, GTK_WIDGET (eprop), 1, row++);
activatable_editor->properties = g_list_prepend (activatable_editor->properties, eprop);
gtk_widget_show_all (GTK_WIDGET (activatable_editor));
......
......@@ -406,24 +406,18 @@ label_toggled (GtkWidget *widget,
button_editor->loaded_widget);
}
static void
table_attach (GtkWidget *table,
GtkWidget *child,
gint pos, gint row,
GtkSizeGroup *group)
gint pos, gint row)
{
gtk_table_attach (GTK_TABLE (table), child,
pos, pos+1, row, row +1,
pos ? 0 : GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL,
3, 1);
gtk_grid_attach (GTK_GRID (table), child,
pos, row, 1, 1);
if (pos)
gtk_size_group_add_widget (group, child);
gtk_widget_set_hexpand (child, TRUE);
}
GtkWidget *
glade_button_editor_new (GladeWidgetAdaptor *adaptor,
GladeEditable *embed)
......@@ -431,7 +425,6 @@ glade_button_editor_new (GladeWidgetAdaptor *adaptor,
GladeButtonEditor *button_editor;
GladeEditorProperty *eprop;
GtkWidget *vbox, *table, *frame;
GtkSizeGroup *group;
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
g_return_val_if_fail (GLADE_IS_EDITABLE (embed), NULL);
......@@ -482,22 +475,21 @@ glade_button_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (button_editor->stock_frame), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), button_editor->stock_frame);
table = gtk_table_new (0, 0, FALSE);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (button_editor->stock_frame), table);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "stock", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 0, group);
table_attach (table, GTK_WIDGET (eprop), 1, 0, group);
table_attach (table, eprop->item_label, 0, 0);
table_attach (table, GTK_WIDGET (eprop), 1, 0);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "image-position", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 1, group);
table_attach (table, GTK_WIDGET (eprop), 1, 1, group);
table_attach (table, eprop->item_label, 0, 1);
table_attach (table, GTK_WIDGET (eprop), 1, 1);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
g_object_unref (group);
/* Populate label frame here... */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
......@@ -508,31 +500,30 @@ glade_button_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (button_editor->label_frame), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), button_editor->label_frame);
table = gtk_table_new (0, 0, FALSE);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (button_editor->label_frame), table);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "label", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 0, group);
table_attach (table, GTK_WIDGET (eprop), 1, 0, group);
table_attach (table, eprop->item_label, 0, 0);
table_attach (table, GTK_WIDGET (eprop), 1, 0);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "use-underline", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 1, group);
table_attach (table, GTK_WIDGET (eprop), 1, 1, group);
table_attach (table, eprop->item_label, 0, 1);
table_attach (table, GTK_WIDGET (eprop), 1, 1);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "image", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 2, group);
table_attach (table, GTK_WIDGET (eprop), 1, 2, group);
table_attach (table, eprop->item_label, 0, 2);
table_attach (table, GTK_WIDGET (eprop), 1, 2);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "image-position", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 3, group);
table_attach (table, GTK_WIDGET (eprop), 1, 3, group);
table_attach (table, eprop->item_label, 0, 3);
table_attach (table, GTK_WIDGET (eprop), 1, 3);
button_editor->properties = g_list_prepend (button_editor->properties, eprop);
g_object_unref (group);
/* Custom radio button on the bottom */
gtk_box_pack_start (GTK_BOX (button_editor), button_editor->custom_radio, FALSE, FALSE, 0);
......
......@@ -479,23 +479,19 @@ secondary_pixbuf_toggled (GtkWidget *widget,
entry_editor->loaded_widget);
}
static void
table_attach (GtkWidget *table,
GtkWidget *child,
gint pos, gint row,
GtkSizeGroup *group)
gint pos, gint row)
{
gtk_table_attach (GTK_TABLE (table), child,
pos, pos+1, row, row +1,
pos ? 0 : GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL,
3, 1);
gtk_grid_attach (GTK_GRID (table), child,
pos, row, 1, 1);
if (pos)
gtk_size_group_add_widget (group, child);
gtk_widget_set_hexpand (child, TRUE);
}
GtkWidget *
glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
GladeEditable *embed)
......@@ -503,7 +499,6 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
GladeEntryEditor *entry_editor;
GladeEditorProperty *eprop;
GtkWidget *table, *frame, *alignment, *label, *hbox;
GtkSizeGroup *group;
gchar *str;
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
......@@ -530,19 +525,19 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), alignment);
table = gtk_table_new (0, 0, FALSE);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (alignment), table);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Text */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "text", FALSE, TRUE);
hbox = gtk_hbox_new (FALSE, 0);
entry_editor->text_radio = gtk_radio_button_new (NULL);
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->text_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 0, group);
table_attach (table, GTK_WIDGET (eprop), 1, 0, group);
table_attach (table, hbox, 0, 0);
table_attach (table, GTK_WIDGET (eprop), 1, 0);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Buffer */
......@@ -552,13 +547,10 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
(GTK_RADIO_BUTTON (entry_editor->text_radio));
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->buffer_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 1, group);
table_attach (table, GTK_WIDGET (eprop), 1, 1, group);
table_attach (table, hbox, 0, 1);
table_attach (table, GTK_WIDGET (eprop), 1, 1);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
g_object_unref (group);
/* Progress... */
str = g_strdup_printf ("<b>%s</b>", _("Progress"));
label = gtk_label_new (str);
......@@ -573,25 +565,23 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), alignment);
table = gtk_table_new (0, 0, FALSE);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (alignment), table);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Fraction */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "progress-fraction", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 0, group);
table_attach (table, GTK_WIDGET (eprop), 1, 0, group);
table_attach (table, eprop->item_label, 0, 0);
table_attach (table, GTK_WIDGET (eprop), 1, 0);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Pulse */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "progress-pulse-step", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 1, group);
table_attach (table, GTK_WIDGET (eprop), 1, 1, group);
table_attach (table, eprop->item_label, 0, 1);
table_attach (table, GTK_WIDGET (eprop), 1, 1);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
g_object_unref (group);
/* Primary icon... */
str = g_strdup_printf ("<b>%s</b>", _("Primary icon"));
label = gtk_label_new (str);
......@@ -606,19 +596,19 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), alignment);
table = gtk_table_new (0, 0, FALSE);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (alignment), table);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Pixbuf */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, PIXBUF_NAME(TRUE), FALSE, TRUE);
hbox = gtk_hbox_new (FALSE, 0);
entry_editor->primary_pixbuf_radio = gtk_radio_button_new (NULL);
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->primary_pixbuf_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 0, group);
table_attach (table, GTK_WIDGET (eprop), 1, 0, group);
table_attach (table, hbox, 0, 0);
table_attach (table, GTK_WIDGET (eprop), 1, 0);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Stock */
......@@ -628,8 +618,8 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
(GTK_RADIO_BUTTON (entry_editor->primary_pixbuf_radio));
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->primary_stock_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 1, group);
table_attach (table, GTK_WIDGET (eprop), 1, 1, group);
table_attach (table, hbox, 0, 1);
table_attach (table, GTK_WIDGET (eprop), 1, 1);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Icon name */
......@@ -639,33 +629,31 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
(GTK_RADIO_BUTTON (entry_editor->primary_pixbuf_radio));
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->primary_icon_name_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 2, group);
table_attach (table, GTK_WIDGET (eprop), 1, 2, group);
table_attach (table, hbox, 0, 2);
table_attach (table, GTK_WIDGET (eprop), 1, 2);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Other primary icon related properties */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "primary-icon-activatable", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 3, group);
table_attach (table, GTK_WIDGET (eprop), 1, 3, group);
table_attach (table, eprop->item_label, 0, 3);
table_attach (table, GTK_WIDGET (eprop), 1, 3);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "primary-icon-sensitive", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 4, group);
table_attach (table, GTK_WIDGET (eprop), 1, 4, group);
table_attach (table, eprop->item_label, 0, 4);
table_attach (table, GTK_WIDGET (eprop), 1, 4);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "primary-icon-tooltip-text", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 5, group);
table_attach (table, GTK_WIDGET (eprop), 1, 5, group);
table_attach (table, eprop->item_label, 0, 5);
table_attach (table, GTK_WIDGET (eprop), 1, 5);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "primary-icon-tooltip-markup", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 6, group);
table_attach (table, GTK_WIDGET (eprop), 1, 6, group);
table_attach (table, eprop->item_label, 0, 6);
table_attach (table, GTK_WIDGET (eprop), 1, 6);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
g_object_unref (group);
/* Secondary icon... */
str = g_strdup_printf ("<b>%s</b>", _("Secondary icon"));
label = gtk_label_new (str);
......@@ -680,19 +668,19 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), alignment);
table = gtk_table_new (0, 0, FALSE);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (alignment), table);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Pixbuf */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, PIXBUF_NAME(FALSE), FALSE, TRUE);
hbox = gtk_hbox_new (FALSE, 0);
entry_editor->secondary_pixbuf_radio = gtk_radio_button_new (NULL);
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->secondary_pixbuf_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 0, group);
table_attach (table, GTK_WIDGET (eprop), 1, 0, group);
table_attach (table, hbox, 0, 0);
table_attach (table, GTK_WIDGET (eprop), 1, 0);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Stock */
......@@ -702,8 +690,8 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
(GTK_RADIO_BUTTON (entry_editor->secondary_pixbuf_radio));
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->secondary_stock_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 1, group);
table_attach (table, GTK_WIDGET (eprop), 1, 1, group);
table_attach (table, hbox, 0, 1);
table_attach (table, GTK_WIDGET (eprop), 1, 1);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Icon name */
......@@ -713,33 +701,31 @@ glade_entry_editor_new (GladeWidgetAdaptor *adaptor,
(GTK_RADIO_BUTTON (entry_editor->secondary_pixbuf_radio));
gtk_box_pack_start (GTK_BOX (hbox), entry_editor->secondary_icon_name_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 2, group);
table_attach (table, GTK_WIDGET (eprop), 1, 2, group);
table_attach (table, hbox, 0, 2);
table_attach (table, GTK_WIDGET (eprop), 1, 2);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
/* Other secondary icon related properties */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "secondary-icon-activatable", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 3, group);
table_attach (table, GTK_WIDGET (eprop), 1, 3, group);
table_attach (table, eprop->item_label, 0, 3);
table_attach (table, GTK_WIDGET (eprop), 1, 3);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "secondary-icon-sensitive", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 4, group);
table_attach (table, GTK_WIDGET (eprop), 1, 4, group);
table_attach (table, eprop->item_label, 0, 4);
table_attach (table, GTK_WIDGET (eprop), 1, 4);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "secondary-icon-tooltip-text", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 5, group);
table_attach (table, GTK_WIDGET (eprop), 1, 5, group);
table_attach (table, eprop->item_label, 0, 5);
table_attach (table, GTK_WIDGET (eprop), 1, 5);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "secondary-icon-tooltip-markup", FALSE, TRUE);
table_attach (table, eprop->item_label, 0, 6, group);
table_attach (table, GTK_WIDGET (eprop), 1, 6, group);
table_attach (table, eprop->item_label, 0, 6);
table_attach (table, GTK_WIDGET (eprop), 1, 6);
entry_editor->properties = g_list_prepend (entry_editor->properties, eprop);
g_object_unref (group);
gtk_widget_show_all (GTK_WIDGET (entry_editor));
......
......@@ -189,17 +189,13 @@ glade_image_editor_grab_focus (GtkWidget *widget)
static void
table_attach (GtkWidget *table,
GtkWidget *child,
gint pos, gint row,
GtkSizeGroup *group)
gint pos, gint row)
{
gtk_table_attach (GTK_TABLE (table), child,
pos, pos+1, row, row +1,
pos ? 0 : GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL,
3, 1);
gtk_grid_attach (GTK_GRID (table), child,
pos, row, 1, 1);
if (pos)
gtk_size_group_add_widget (group, child);
gtk_widget_set_hexpand (child, TRUE);
}
static void
......@@ -329,7 +325,6 @@ glade_image_editor_new (GladeWidgetAdaptor *adaptor,
GladeImageEditor *image_editor;
GladeEditorProperty *eprop;
GtkWidget *table, *frame, *alignment, *label, *hbox;
GtkSizeGroup *group;
gchar *str;
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
......@@ -355,19 +350,19 @@ glade_image_editor_new (GladeWidgetAdaptor *adaptor,
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0);
gtk_container_add (GTK_CONTAINER (frame), alignment);
table = gtk_table_new (0, 0, FALSE);
table = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (table), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_container_add (GTK_CONTAINER (alignment), table);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Stock image... */
eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "stock", FALSE, TRUE);
hbox = gtk_hbox_new (FALSE, 0);
image_editor->stock_radio = gtk_radio_button_new (NULL);
gtk_box_pack_start (GTK_BOX (hbox), image_editor->stock_radio, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), eprop->item_label, TRUE, TRUE, 2);
table_attach (table, hbox, 0, 0, group);
table_attach (table, GTK_WIDGET (eprop), 1, 0, group);
table_attach (table, hbox, 0, 0);
table_attach (table, GTK_WIDGET (eprop), 1, 0);
image_editor->properties = g_list_prepend (image_editor->properties, eprop);
/* Icon theme image... */
......@@ -377,8 +372,8 @@ glade_image_editor_new (GladeWidgetAdaptor *adaptor,
(GTK_RADIO_BUTTON (image_editor->stock_radio));
gtk_box_pack_start (GTK_BOX (hbox), image_editor->icon_radio, FALSE, FALSE, 2);
gtk_box_pack_start (