script-fu: kill GtkTable

This commit is contained in:
Simon Budig 2018-05-06 00:45:37 +02:00 committed by Michael Natterer
parent def4acc842
commit fb5d463d78
2 changed files with 40 additions and 41 deletions

View File

@ -52,7 +52,7 @@ typedef struct
{ {
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *table; GtkWidget *grid;
GtkWidget **widgets; GtkWidget **widgets;
GtkWidget *progress_label; GtkWidget *progress_label;
@ -264,12 +264,12 @@ script_fu_interface (SFScript *script,
gtk_widget_show (vbox); gtk_widget_show (vbox);
/* The argument table */ /* The argument table */
sf_interface->table = gtk_table_new (script->n_args - start_arg, 3, FALSE); sf_interface->grid = gtk_grid_new ();
gtk_table_set_col_spacings (GTK_TABLE (sf_interface->table), 6); gtk_grid_set_row_spacing (GTK_GRID (sf_interface->grid), 6);
gtk_table_set_row_spacings (GTK_TABLE (sf_interface->table), 6); gtk_grid_set_column_spacing (GTK_GRID (sf_interface->grid), 6);
gtk_box_pack_start (GTK_BOX (vbox), sf_interface->table, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), sf_interface->grid, FALSE, FALSE, 0);
gtk_widget_show (sf_interface->table); gtk_widget_show (sf_interface->grid);
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@ -409,17 +409,17 @@ script_fu_interface (SFScript *script,
{ {
case SF_SLIDER: case SF_SLIDER:
arg->value.sfa_adjustment.adj = (GtkAdjustment *) arg->value.sfa_adjustment.adj = (GtkAdjustment *)
gimp_scale_entry_new (GTK_TABLE (sf_interface->table), gimp_scale_entry_new_grid (GTK_GRID (sf_interface->grid),
0, row, 0, row,
label_text, SLIDER_WIDTH, -1, label_text, SLIDER_WIDTH, -1,
arg->value.sfa_adjustment.value, arg->value.sfa_adjustment.value,
arg->default_value.sfa_adjustment.lower, arg->default_value.sfa_adjustment.lower,
arg->default_value.sfa_adjustment.upper, arg->default_value.sfa_adjustment.upper,
arg->default_value.sfa_adjustment.step, arg->default_value.sfa_adjustment.step,
arg->default_value.sfa_adjustment.page, arg->default_value.sfa_adjustment.page,
arg->default_value.sfa_adjustment.digits, arg->default_value.sfa_adjustment.digits,
TRUE, 0.0, 0.0, TRUE, 0.0, 0.0,
NULL, NULL); NULL, NULL);
gtk_entry_set_activates_default (GIMP_SCALE_ENTRY_SPINBUTTON (arg->value.sfa_adjustment.adj), TRUE); gtk_entry_set_activates_default (GIMP_SCALE_ENTRY_SPINBUTTON (arg->value.sfa_adjustment.adj), TRUE);
break; break;
@ -552,17 +552,16 @@ script_fu_interface (SFScript *script,
{ {
if (label_text) if (label_text)
{ {
gimp_table_attach_aligned (GTK_TABLE (sf_interface->table), gimp_grid_attach_aligned (GTK_GRID (sf_interface->grid),
0, row, 0, row,
label_text, 0.0, label_yalign, label_text, 0.0, label_yalign,
widget, 2, left_align); widget, 2);
g_free (label_text); g_free (label_text);
} }
else else
{ {
gtk_table_attach (GTK_TABLE (sf_interface->table), gtk_grid_attach (GTK_GRID (sf_interface->grid),
widget, 0, 3, row, row + 1, widget, 0, row, 3, 1);
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (widget); gtk_widget_show (widget);
} }
@ -767,7 +766,7 @@ script_fu_response (GtkWidget *widget,
break; break;
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
gtk_widget_set_sensitive (sf_interface->table, FALSE); gtk_widget_set_sensitive (sf_interface->grid, FALSE);
gtk_widget_set_sensitive (action_area, FALSE); gtk_widget_set_sensitive (action_area, FALSE);
script_fu_ok (script); script_fu_ok (script);

View File

@ -818,7 +818,7 @@ server_interface (void)
{ {
GtkWidget *dlg; GtkWidget *dlg;
GtkWidget *main_vbox; GtkWidget *main_vbox;
GtkWidget *table; GtkWidget *grid;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *image; GtkWidget *image;
GtkWidget *label; GtkWidget *label;
@ -854,32 +854,32 @@ server_interface (void)
main_vbox, TRUE, TRUE, 0); main_vbox, TRUE, TRUE, 0);
gtk_widget_show (main_vbox); gtk_widget_show (main_vbox);
/* The table to hold port, logfile and listen-to entries */ /* The grid to hold port, logfile and listen-to entries */
table = gtk_table_new (3, 2, FALSE); grid = gtk_grid_new ();
gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (main_vbox), grid, FALSE, FALSE, 0);
gtk_widget_show (table); gtk_widget_show (grid);
/* The server ip to listen to */ /* The server ip to listen to */
sint.ip_entry = gtk_entry_new (); sint.ip_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (sint.ip_entry), "127.0.0.1"); gtk_entry_set_text (GTK_ENTRY (sint.ip_entry), "127.0.0.1");
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0,
_("Listen on IP:"), 0.0, 0.5, _("Listen on IP:"), 0.0, 0.5,
sint.ip_entry, 1, FALSE); sint.ip_entry, 1);
/* The server port */ /* The server port */
sint.port_entry = gtk_entry_new (); sint.port_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (sint.port_entry), "10008"); gtk_entry_set_text (GTK_ENTRY (sint.port_entry), "10008");
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1,
_("Server port:"), 0.0, 0.5, _("Server port:"), 0.0, 0.5,
sint.port_entry, 1, FALSE); sint.port_entry, 1);
/* The server logfile */ /* The server logfile */
sint.log_entry = gtk_entry_new (); sint.log_entry = gtk_entry_new ();
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, gimp_grid_attach_aligned (GTK_GRID (grid), 0, 2,
_("Server logfile:"), 0.0, 0.5, _("Server logfile:"), 0.0, 0.5,
sint.log_entry, 1, FALSE); sint.log_entry, 1);
/* Warning */ /* Warning */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);