[gimp/gtk3-port: 301/440] plug-ins: try to catch all gtk_table_* uses for the size-entries



commit f19f7da53a9e528a3944b8f30b307a837894e68d
Author: Simon Budig <simon budig de>
Date:   Wed May 2 20:37:47 2018 +0200

    plug-ins: try to catch all gtk_table_* uses for the size-entries

 plug-ins/common/border-average.c   |    2 --
 plug-ins/common/checkerboard.c     |    2 --
 plug-ins/common/file-svg.c         |    2 --
 plug-ins/common/file-wmf.c         |    2 --
 plug-ins/common/grid.c             |   16 ++++++----------
 plug-ins/common/tile.c             |    1 -
 plug-ins/print/print-page-layout.c |   15 +++++----------
 7 files changed, 11 insertions(+), 29 deletions(-)
---
diff --git a/plug-ins/common/border-average.c b/plug-ins/common/border-average.c
index c8144a2..f13723d 100644
--- a/plug-ins/common/border-average.c
+++ b/plug-ins/common/border-average.c
@@ -414,8 +414,6 @@ borderaverage_dialog (gint32        image_ID,
 
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (size_entry), 0,
                                          1.0, 256.0);
-  gtk_table_set_col_spacing (GTK_TABLE (size_entry), 0, 4);
-  gtk_table_set_col_spacing (GTK_TABLE (size_entry), 2, 12);
   gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (size_entry), 0,
                               (gdouble) borderaverage_thickness);
   g_signal_connect (size_entry, "value-changed",
diff --git a/plug-ins/common/checkerboard.c b/plug-ins/common/checkerboard.c
index 88918a3..6b92f3a 100644
--- a/plug-ins/common/checkerboard.c
+++ b/plug-ins/common/checkerboard.c
@@ -387,8 +387,6 @@ checkerboard_dialog (gint32        image_ID,
   size_entry = gimp_size_entry_new (1, unit, "%a",
                                     TRUE, TRUE, FALSE, SPIN_BUTTON_WIDTH,
                                     GIMP_SIZE_ENTRY_UPDATE_SIZE);
-  gtk_table_set_col_spacing (GTK_TABLE (size_entry), 0, 4);
-  gtk_table_set_col_spacing (GTK_TABLE (size_entry), 1, 4);
   gtk_box_pack_start (GTK_BOX (hbox), size_entry, FALSE, FALSE, 0);
   gtk_widget_show (size_entry);
 
diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c
index d199a80..5a27944 100644
--- a/plug-ins/common/file-svg.c
+++ b/plug-ins/common/file-svg.c
@@ -816,7 +816,6 @@ load_dialog (const gchar  *filename,
   size = GIMP_SIZE_ENTRY (gimp_size_entry_new (1, GIMP_UNIT_PIXEL, "%a",
                                                TRUE, FALSE, FALSE, 10,
                                                GIMP_SIZE_ENTRY_UPDATE_SIZE));
-  gtk_table_set_col_spacing (GTK_TABLE (size), 1, 6);
 
   gimp_size_entry_add_field (size, GTK_SPIN_BUTTON (spinbutton), NULL);
 
@@ -916,7 +915,6 @@ load_dialog (const gchar  *filename,
   res = gimp_size_entry_new (1, GIMP_UNIT_INCH, _("pixels/%a"),
                              FALSE, FALSE, FALSE, 10,
                              GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
-  gtk_table_set_col_spacing (GTK_TABLE (res), 1, 6);
 
   gtk_table_attach (GTK_TABLE (table), res, 1, 2, 4, 5,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
diff --git a/plug-ins/common/file-wmf.c b/plug-ins/common/file-wmf.c
index e1fcfb8..9022caa 100644
--- a/plug-ins/common/file-wmf.c
+++ b/plug-ins/common/file-wmf.c
@@ -600,7 +600,6 @@ load_dialog (const gchar *filename)
   size = GIMP_SIZE_ENTRY (gimp_size_entry_new (1, GIMP_UNIT_PIXEL, "%a",
                                                TRUE, FALSE, FALSE, 10,
                                                GIMP_SIZE_ENTRY_UPDATE_SIZE));
-  gtk_table_set_col_spacing (GTK_TABLE (size), 1, 6);
 
   gimp_size_entry_add_field (size, GTK_SPIN_BUTTON (spinbutton), NULL);
 
@@ -700,7 +699,6 @@ load_dialog (const gchar *filename)
   res = gimp_size_entry_new (1, GIMP_UNIT_INCH, _("pixels/%a"),
                              FALSE, FALSE, FALSE, 10,
                              GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
-  gtk_table_set_col_spacing (GTK_TABLE (res), 1, 6);
 
   gtk_table_attach (GTK_TABLE (table), res, 1, 2, 4, 5,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
diff --git a/plug-ins/common/grid.c b/plug-ins/common/grid.c
index 8eb5930..2921c40 100644
--- a/plug-ins/common/grid.c
+++ b/plug-ins/common/grid.c
@@ -713,9 +713,7 @@ dialog (gint32        image_ID,
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (width), 2, 0.0,
                                          MAX (drawable->width,
                                               drawable->height));
-  gtk_table_set_row_spacing (GTK_TABLE (width), 0, 6);
-  gtk_table_set_col_spacings (GTK_TABLE (width), 6);
-  gtk_table_set_col_spacing (GTK_TABLE (width), 2, 12);
+  gtk_grid_set_column_spacing (GTK_GRID (width), 6);
 
   /*  initialize the values  */
   gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (width), 0, grid_cfg.hwidth);
@@ -741,7 +739,7 @@ dialog (gint32        image_ID,
   chain_button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM);
   if (grid_cfg.hwidth == grid_cfg.vwidth)
     gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain_button), TRUE);
-  gtk_table_attach_defaults (GTK_TABLE (width), chain_button, 1, 3, 2, 3);
+  gtk_grid_attach (GTK_GRID (width), chain_button, 1, 2, 2, 1);
   gtk_widget_show (chain_button);
 
   /* connect to the 'value-changed' signal because we have to take care
@@ -787,8 +785,7 @@ dialog (gint32        image_ID,
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (space), 2, 0.0,
                                          MAX (drawable->width,
                                               drawable->height));
-  gtk_table_set_col_spacings (GTK_TABLE (space), 6);
-  gtk_table_set_col_spacing (GTK_TABLE (space), 2, 12);
+  gtk_grid_set_column_spacing (GTK_GRID (space), 6);
 
   /*  initialize the values  */
   gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (space), 0, grid_cfg.hspace);
@@ -804,7 +801,7 @@ dialog (gint32        image_ID,
   chain_button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM);
   if (grid_cfg.hspace == grid_cfg.vspace)
     gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain_button), TRUE);
-  gtk_table_attach_defaults (GTK_TABLE (space), chain_button, 1, 3, 2, 3);
+  gtk_grid_attach (GTK_GRID (space), chain_button, 1, 2, 2, 1);
   gtk_widget_show (chain_button);
 
   /* connect to the 'value-changed' and "unit-changed" signals because
@@ -854,8 +851,7 @@ dialog (gint32        image_ID,
   gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (offset), 2, 0.0,
                                          MAX (drawable->width,
                                               drawable->height));
-  gtk_table_set_col_spacings (GTK_TABLE (offset), 6);
-  gtk_table_set_col_spacing (GTK_TABLE (offset), 2, 12);
+  gtk_grid_set_column_spacing (GTK_GRID (offset), 6);
 
   /*  initialize the values  */
   gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (offset), 0, grid_cfg.hoffset);
@@ -869,7 +865,7 @@ dialog (gint32        image_ID,
 
   /*  this is a weird hack: we put a table into the offset table  */
   table = gtk_table_new (3, 3, FALSE);
-  gtk_table_attach_defaults (GTK_TABLE (offset), table, 1, 4, 2, 3);
+  gtk_grid_attach (GTK_GRID (offset), table, 1, 2, 3, 1);
   gtk_table_set_row_spacing (GTK_TABLE (table), 0, 10);
   gtk_table_set_col_spacing (GTK_TABLE (table), 1, 12);
 
diff --git a/plug-ins/common/tile.c b/plug-ins/common/tile.c
index 177da16..b3a7593 100644
--- a/plug-ins/common/tile.c
+++ b/plug-ins/common/tile.c
@@ -470,7 +470,6 @@ tile_dialog (gint32 image_ID,
                                     1, GIMP_MAX_IMAGE_SIZE,
                                     0, height);
   gtk_container_add (GTK_CONTAINER (frame), sizeentry);
-  gtk_table_set_row_spacing (GTK_TABLE (sizeentry), 1, 6);
   gtk_widget_show (sizeentry);
 
   chainbutton = GTK_WIDGET (GIMP_COORDINATES_CHAINBUTTON (sizeentry));
diff --git a/plug-ins/print/print-page-layout.c b/plug-ins/print/print-page-layout.c
index 3af04bc..e3d27e5 100644
--- a/plug-ins/print/print-page-layout.c
+++ b/plug-ins/print/print-page-layout.c
@@ -266,16 +266,14 @@ print_size_frame (PrintData    *data,
 
   info.size_entry = GIMP_SIZE_ENTRY (entry);
 
-  gtk_table_set_row_spacings (GTK_TABLE (entry), 2);
-  gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
-  gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
+  gtk_grid_set_row_spacing (GTK_GRID (entry), 2);
 
   adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
   height = gtk_spin_button_new (adj, 1, 2);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
   gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
                              GTK_SPIN_BUTTON (height), NULL);
-  gtk_table_attach_defaults (GTK_TABLE (entry), height, 1, 2, 0, 1);
+  gtk_grid_attach (GTK_TABLE (entry), height, 1, 0, 1, 1);
   gtk_widget_show (height);
 
   gtk_size_group_add_widget (entry_group, height);
@@ -310,16 +308,14 @@ print_size_frame (PrintData    *data,
 
   info.resolution_entry = GIMP_SIZE_ENTRY (entry);
 
-  gtk_table_set_row_spacings (GTK_TABLE (entry), 2);
-  gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
-  gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
+  gtk_grid_set_row_spacing (GTK_GRID (entry), 2);
 
   adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
   height = gtk_spin_button_new (adj, 1, 2);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
   gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
                              GTK_SPIN_BUTTON (height), NULL);
-  gtk_table_attach_defaults (GTK_TABLE (entry), height, 1, 2, 0, 1);
+  gtk_grid_attach (GTK_GRID (entry), height, 1, 0, 1, 1);
   gtk_widget_show (height);
 
   gtk_size_group_add_widget (entry_group, height);
@@ -352,8 +348,7 @@ print_size_frame (PrintData    *data,
   chain = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
   if (ABS (data->xres - data->yres) < GIMP_MIN_RESOLUTION)
     gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain), TRUE);
-  gtk_table_attach (GTK_TABLE (entry), chain, 2, 3, 0, 2,
-                    GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+  gtk_grid_attach (GTK_GRID (entry), chain, 2, 0, 1, 2);
   gtk_widget_show (chain);
 
   info.chain = GIMP_CHAIN_BUTTON (chain);


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