[gimp] plug-ins: kill GtkAlignment in all plug-ins which are currently built



commit 6bb8c74a46b9ece01d28cadbf3316b3e72192607
Author: Michael Natterer <mitch gimp org>
Date:   Mon Oct 22 14:47:54 2018 +0200

    plug-ins: kill GtkAlignment in all plug-ins which are currently built

 plug-ins/common/filter-pack.c                      | 10 ++++-----
 plug-ins/file-ico/ico-dialog.c                     | 11 ++++------
 plug-ins/flame/flame.c                             |  8 ++------
 .../fractal-explorer/fractal-explorer-dialogs.c    | 22 ++++++++------------
 plug-ins/gradient-flare/gradient-flare.c           | 24 ++++++++--------------
 5 files changed, 27 insertions(+), 48 deletions(-)
---
diff --git a/plug-ins/common/filter-pack.c b/plug-ins/common/filter-pack.c
index dc7312f18a..e681e3bc3a 100644
--- a/plug-ins/common/filter-pack.c
+++ b/plug-ins/common/filter-pack.c
@@ -1279,7 +1279,7 @@ fp_advanced_dialog (GtkWidget *parent)
   GtkWidget     *frame, *hbox;
   GtkAdjustment *smoothnessData;
   GtkWidget     *graphFrame, *scale;
-  GtkWidget     *vbox, *label, *labelGrid, *alignment;
+  GtkWidget     *vbox, *label, *labelGrid;
   GtkWidget     *inner_vbox, *innermost_vbox;
   gint           i;
 
@@ -1318,12 +1318,10 @@ fp_advanced_dialog (GtkWidget *parent)
   gtk_container_add (GTK_CONTAINER (graphFrame), inner_vbox);
   gtk_widget_show (inner_vbox);
 
-  alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
-  gtk_box_pack_start (GTK_BOX (inner_vbox), alignment, TRUE, TRUE, 0);
-  gtk_widget_show (alignment);
-
   innermost_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-  gtk_container_add (GTK_CONTAINER (alignment), innermost_vbox);
+  gtk_widget_set_halign (innermost_vbox, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (innermost_vbox, GTK_ALIGN_CENTER);
+  gtk_box_pack_start (GTK_BOX (inner_vbox), innermost_vbox, TRUE, TRUE, 0);
   gtk_widget_show (innermost_vbox);
 
   AW.aliasing_preview = gimp_preview_area_new ();
diff --git a/plug-ins/file-ico/ico-dialog.c b/plug-ins/file-ico/ico-dialog.c
index 84e990905f..c58e369e5f 100644
--- a/plug-ins/file-ico/ico-dialog.c
+++ b/plug-ins/file-ico/ico-dialog.c
@@ -135,16 +135,11 @@ ico_create_icon_hbox (GtkWidget   *icon_preview,
 
   GtkWidget *hbox;
   GtkWidget *vbox;
-  GtkWidget *alignment;
   GtkWidget *combo;
   GtkWidget *checkbox;
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
 
-  alignment = gtk_alignment_new (1.0, 0.5, 0, 0);
-  gtk_box_pack_start (GTK_BOX (hbox), alignment, FALSE, FALSE, 0);
-  gtk_widget_show (alignment);
-
   /* To make life easier for the callbacks, we store the
      layer's ID and stacking number with the hbox. */
 
@@ -154,13 +149,15 @@ ico_create_icon_hbox (GtkWidget   *icon_preview,
                      "icon_layer_num", GINT_TO_POINTER (layer_num));
 
   g_object_set_data (G_OBJECT (hbox), "icon_preview", icon_preview);
-  gtk_container_add (GTK_CONTAINER (alignment), icon_preview);
+  gtk_widget_set_halign (icon_preview, GTK_ALIGN_END);
+  gtk_widget_set_valign (icon_preview, GTK_ALIGN_CENTER);
+  gtk_box_pack_start (GTK_BOX (hbox), icon_preview, FALSE, FALSE, 0);
   gtk_widget_show (icon_preview);
 
   if (! size)
     size = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
-  gtk_size_group_add_widget (size, alignment);
+  gtk_size_group_add_widget (size, icon_preview);
 
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
   gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
diff --git a/plug-ins/flame/flame.c b/plug-ins/flame/flame.c
index 29289d8728..f7c4ca7a58 100644
--- a/plug-ins/flame/flame.c
+++ b/plug-ins/flame/flame.c
@@ -958,7 +958,6 @@ flame_dialog (void)
   GtkWidget     *notebook;
   GtkWidget     *label;
   GtkWidget     *frame;
-  GtkWidget     *abox;
   GtkWidget     *button;
   GtkWidget     *grid;
   GtkWidget     *box;
@@ -993,13 +992,10 @@ flame_dialog (void)
   gtk_box_pack_start (GTK_BOX (main_vbox), box, FALSE, FALSE, 0);
   gtk_widget_show (box);
 
-  abox = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
-  gtk_box_pack_start (GTK_BOX (box), abox, FALSE, FALSE, 0);
-  gtk_widget_show (abox);
-
   frame = gtk_frame_new (NULL);
+  gtk_widget_set_valign (frame, GTK_ALIGN_START);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-  gtk_container_add (GTK_CONTAINER (abox), frame);
+  gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE, 0);
   gtk_widget_show (frame);
 
   flame_preview = gimp_preview_area_new ();
diff --git a/plug-ins/fractal-explorer/fractal-explorer-dialogs.c 
b/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
index e4fac348fa..b79f948f90 100644
--- a/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
+++ b/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
@@ -509,7 +509,6 @@ explorer_dialog (void)
   GtkWidget *dialog;
   GtkWidget *top_hbox;
   GtkWidget *left_vbox;
-  GtkWidget *abox;
   GtkWidget *vbox;
   GtkWidget *bbox;
   GtkWidget *frame;
@@ -599,13 +598,10 @@ explorer_dialog (void)
   gtk_box_pack_start (GTK_BOX (left_vbox), vbox, FALSE, FALSE, 0);
   gtk_widget_show (vbox);
 
-  abox = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
-  gtk_box_pack_start (GTK_BOX (vbox), abox, FALSE, FALSE, 0);
-  gtk_widget_show (abox);
-
   frame = gtk_frame_new (NULL);
+  gtk_widget_set_halign (frame, GTK_ALIGN_START);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-  gtk_container_add (GTK_CONTAINER (abox), frame);
+  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
   gtk_widget_show (frame);
 
   wint.preview = gimp_preview_area_new ();
@@ -1178,22 +1174,22 @@ explorer_dialog (void)
   gtk_box_pack_start (GTK_BOX (hbox), gradient, FALSE, FALSE, 0);
   gtk_widget_show (gradient);
 
-  abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   {
     gint xsize, ysize;
-
     for (ysize = 1; ysize * ysize * ysize < 8192; ysize++) /**/;
     xsize = wvals.ncolors / ysize;
     while (xsize * ysize < 8192) xsize++;
-
-    gtk_widget_set_size_request (abox, xsize, ysize * 4);
+    gtk_widget_set_size_request (hbox, xsize, ysize * 4);
   }
-  gtk_box_pack_start (GTK_BOX (toggle_vbox), abox, FALSE, FALSE, 0);
-  gtk_widget_show (abox);
+  gtk_box_pack_start (GTK_BOX (toggle_vbox), hbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbox);
 
   cmap_preview = gimp_preview_area_new ();
+  gtk_widget_set_halign (cmap_preview, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (cmap_preview, GTK_ALIGN_CENTER);
   gtk_widget_set_size_request (cmap_preview, 32, 32);
-  gtk_container_add (GTK_CONTAINER (abox), cmap_preview);
+  gtk_box_pack_start (GTK_BOX (hbox), cmap_preview, TRUE, TRUE, 0);
   g_signal_connect (cmap_preview, "size-allocate",
                     G_CALLBACK (cmap_preview_size_allocate), NULL);
   gtk_widget_show (cmap_preview);
diff --git a/plug-ins/gradient-flare/gradient-flare.c b/plug-ins/gradient-flare/gradient-flare.c
index 78b9167b0a..7ac25b045f 100644
--- a/plug-ins/gradient-flare/gradient-flare.c
+++ b/plug-ins/gradient-flare/gradient-flare.c
@@ -1558,8 +1558,8 @@ static void
 gflare_name_copy (gchar       *dest,
                   const gchar *src)
 {
-  strncpy (dest, src, GFLARE_NAME_MAX);
-  dest[GFLARE_NAME_MAX-1] = '\0';
+  strncpy (dest, src, GFLARE_NAME_MAX - 1);
+  dest[GFLARE_NAME_MAX - 1] = '\0';
 }
 
 /*************************************************************************/
@@ -2332,7 +2332,6 @@ dlg_run (void)
   GtkWidget *hbox;
   GtkWidget *vbox;
   GtkWidget *frame;
-  GtkWidget *abox;
   GtkWidget *button;
   GtkWidget *notebook;
   gboolean   run = FALSE;
@@ -2390,13 +2389,10 @@ dlg_run (void)
   gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
   gtk_widget_show (vbox);
 
-  abox = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
-  gtk_box_pack_start (GTK_BOX (vbox), abox, TRUE, TRUE, 0);
-  gtk_widget_show (abox);
-
   frame = gtk_frame_new (NULL);
+  gtk_widget_set_valign (frame, GTK_ALIGN_START);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-  gtk_container_add (GTK_CONTAINER (abox), frame);
+  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
   gtk_widget_show (frame);
 
   dlg->preview = preview_new (DLG_PREVIEW_WIDTH, DLG_PREVIEW_HEIGHT,
@@ -3304,7 +3300,6 @@ ed_run (GtkWindow            *parent,
   GtkWidget *shell;
   GtkWidget *hbox;
   GtkWidget *frame;
-  GtkWidget *abox;
   GtkWidget *notebook;
 
   if (!ed)
@@ -3357,13 +3352,10 @@ ed_run (GtkWindow            *parent,
    *    Preview
    */
 
-  abox = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
-  gtk_box_pack_start (GTK_BOX (hbox), abox, FALSE, FALSE, 0);
-  gtk_widget_show (abox);
-
   frame = gtk_frame_new (NULL);
+  gtk_widget_set_valign (frame, GTK_ALIGN_START);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-  gtk_container_add (GTK_CONTAINER (abox), frame);
+  gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
   gtk_widget_show (frame);
 
   ed->preview = preview_new (ED_PREVIEW_WIDTH, ED_PREVIEW_HEIGHT,
@@ -4638,8 +4630,8 @@ static void
 gradient_name_copy (gchar       *dest,
                     const gchar *src)
 {
-  strncpy (dest, src, GRADIENT_NAME_MAX);
-  dest[GRADIENT_NAME_MAX-1] = '\0';
+  strncpy (dest, src, GRADIENT_NAME_MAX - 1);
+  dest[GRADIENT_NAME_MAX - 1] = '\0';
 }
 
 /*


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