[gtranslator: 8/15] Remove remaining uses of gtk_box_pack_start




commit da65734fd9399c9e26d2f19594970c5886dd169c
Author: Maximiliano Sandoval R <msandova gnome org>
Date:   Wed Mar 16 11:36:29 2022 +0100

    Remove remaining uses of gtk_box_pack_start

 src/codeview/gtr-viewer.c                              |  3 ++-
 src/gtr-context.c                                      |  9 +++++----
 src/gtr-header-dialog.c                                |  2 +-
 src/gtr-io-error-info-bar.c                            | 12 ++++++++----
 src/gtr-jump-dialog.c                                  |  3 ++-
 src/gtr-languages-fetcher.c                            |  2 +-
 src/gtr-preferences-dialog.c                           |  2 +-
 src/gtr-profile-dialog.c                               |  6 +++---
 src/gtr-tab.c                                          |  2 +-
 src/gtr-upload-dialog.c                                |  3 ++-
 src/translation-memory/gtr-translation-memory-dialog.c |  4 +++-
 11 files changed, 29 insertions(+), 19 deletions(-)
---
diff --git a/src/codeview/gtr-viewer.c b/src/codeview/gtr-viewer.c
index 72b46b8d..58c67e5e 100644
--- a/src/codeview/gtr-viewer.c
+++ b/src/codeview/gtr-viewer.c
@@ -93,7 +93,8 @@ gtr_viewer_init (GtrViewer *dlg)
   priv->filename_label = GTK_WIDGET (gtk_builder_get_object (builder, "filename_label"));
   g_object_unref (builder);
 
-  gtk_box_pack_start (content_area, priv->main_box, TRUE, TRUE, 0);
+  gtk_widget_set_vexpand (priv->main_box, TRUE);
+  gtk_box_append (content_area, priv->main_box);
 
   gtk_container_set_border_width (GTK_CONTAINER (priv->main_box), 5);
 
diff --git a/src/gtr-context.c b/src/gtr-context.c
index b0fb96f5..d3f36b65 100644
--- a/src/gtr-context.c
+++ b/src/gtr-context.c
@@ -22,6 +22,7 @@
 #include "gtr-context.h"
 #include "gtr-tab.h"
 #include "gtr-debug.h"
+#include "gtr-utils.h"
 #include "translation-memory/gtr-translation-memory-ui.h"
 
 #include <glib.h>
@@ -125,7 +126,8 @@ setup_notes_edition (GtrContextPanel *panel)
                                          text_view);
   gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 5);
 
-  gtk_box_pack_start (dialog_area, scrolled_window, TRUE, TRUE, 6);
+  gtk_widget_set_vexpand (scrolled_window, TRUE);
+  gtk_box_append (dialog_area, scrolled_window);
 
   text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
   gtk_text_buffer_set_text (text_buffer, gtr_msg_get_comment (priv->current_msg), -1);
@@ -591,7 +593,6 @@ gtr_context_init_tm (GtrContextPanel *panel,
                                                                tm);
   gtk_widget_show (priv->translation_memory_ui);
   gtk_widget_set_size_request (priv->translation_memory_ui, 300, 400);
-  gtk_box_pack_start (GTK_BOX (priv->translation_memory_box),
-                      priv->translation_memory_ui,
-                      FALSE, FALSE, 0);
+  gtk_box_append (GTK_BOX (priv->translation_memory_box),
+                  priv->translation_memory_ui);
 }
diff --git a/src/gtr-header-dialog.c b/src/gtr-header-dialog.c
index 39c616f8..051a6a8a 100644
--- a/src/gtr-header-dialog.c
+++ b/src/gtr-header-dialog.c
@@ -362,7 +362,7 @@ gtr_header_dialog_init (GtrHeaderDialog * dlg)
 
   g_object_unref (builder);
 
-  gtk_box_pack_start (content_area, priv->main_box, FALSE, FALSE, 0);
+  gtk_box_append (content_area, priv->main_box);
 
   gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), 5);
 
diff --git a/src/gtr-io-error-info-bar.c b/src/gtr-io-error-info-bar.c
index 108b1127..de90b416 100644
--- a/src/gtr-io-error-info-bar.c
+++ b/src/gtr-io-error-info-bar.c
@@ -18,6 +18,7 @@
  */
 
 #include "gtr-io-error-info-bar.h"
+#include "gtr-utils.h"
 
 #include <glib.h>
 #include <gtk/gtk.h>
@@ -54,13 +55,14 @@ set_info_bar_text_and_icon (GtkInfoBar * infobar,
 
   image = gtk_image_new_from_icon_name (icon_stock_id, GTK_ICON_SIZE_DIALOG);
   gtk_widget_show (image);
-  gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
+  gtk_box_append (GTK_BOX (hbox_content), image);
   gtk_widget_set_halign (image, 0.5);
   gtk_widget_set_valign (image, 0.0);
 
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_widget_show (vbox);
-  gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
+  gtk_widget_set_hexpand (vbox, TRUE);
+  gtk_box_append (GTK_BOX (hbox_content), vbox);
 
   primary_markup = g_strdup_printf ("<b>%s</b>", primary_text);
   primary_label = gtk_label_new (primary_markup);
@@ -68,7 +70,8 @@ set_info_bar_text_and_icon (GtkInfoBar * infobar,
 
   gtk_widget_show (primary_label);
 
-  gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
+  gtk_widget_set_vexpand (primary_label, TRUE);
+  gtk_box_append (GTK_BOX (vbox), primary_label);
   gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
   gtk_label_set_line_wrap (GTK_LABEL (primary_label), FALSE);
   gtk_label_set_xalign (GTK_LABEL (primary_label), 0.0);
@@ -87,7 +90,8 @@ set_info_bar_text_and_icon (GtkInfoBar * infobar,
 
       gtk_widget_show (secondary_label);
 
-      gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0);
+      gtk_widget_set_vexpand (secondary_label, TRUE);
+      gtk_box_append (GTK_BOX (vbox), secondary_label);
 
       gtk_widget_set_can_focus (secondary_label, TRUE);
 
diff --git a/src/gtr-jump-dialog.c b/src/gtr-jump-dialog.c
index 980a08e0..d37864ae 100644
--- a/src/gtr-jump-dialog.c
+++ b/src/gtr-jump-dialog.c
@@ -113,7 +113,8 @@ gtr_jump_dialog_init (GtrJumpDialog * dlg)
   priv->jump = GTK_WIDGET (gtk_builder_get_object (builder, "jump"));
   g_object_unref (builder);
 
-  gtk_box_pack_start (content_area, priv->main_box, TRUE, TRUE, 0);
+  gtk_widget_set_vexpand (priv->main_box, TRUE);
+  gtk_box_append (content_area, priv->main_box);
 
   gtk_container_set_border_width (GTK_CONTAINER (priv->main_box), 5);
 }
diff --git a/src/gtr-languages-fetcher.c b/src/gtr-languages-fetcher.c
index 4068bce8..f50318db 100644
--- a/src/gtr-languages-fetcher.c
+++ b/src/gtr-languages-fetcher.c
@@ -355,7 +355,7 @@ gtr_languages_fetcher_init (GtrLanguagesFetcher *fetcher)
 
   g_object_unref (builder);
 
-  gtk_box_pack_start (GTK_BOX (fetcher), content, FALSE, FALSE, 0);
+  gtk_box_append (GTK_BOX (fetcher), content);
 
   /* add items to comboboxes */
   append_from_languages (fetcher);
diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c
index 70720f14..ae0fa1db 100644
--- a/src/gtr-preferences-dialog.c
+++ b/src/gtr-preferences-dialog.c
@@ -686,7 +686,7 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
   profiles_scrolled_window = GTK_WIDGET (gtk_builder_get_object (builder, "profiles-scrolledwindow"));
   g_object_unref (builder);
 
-  gtk_box_pack_start (content_area, priv->notebook, FALSE, FALSE, 0);
+  gtk_box_append (content_area, priv->notebook);
 
   gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), 5);
 
diff --git a/src/gtr-profile-dialog.c b/src/gtr-profile-dialog.c
index d27d8387..4fcdf040 100644
--- a/src/gtr-profile-dialog.c
+++ b/src/gtr-profile-dialog.c
@@ -100,12 +100,12 @@ gtr_profile_dialog_init (GtrProfileDialog *dlg)
   fetcher_box = GTK_WIDGET (gtk_builder_get_object (builder, "fetcher_box"));
   g_object_unref (builder);
 
-  gtk_box_pack_start (content_area, priv->main_box, FALSE, FALSE, 0);
+  gtk_box_append (content_area, priv->main_box);
 
   priv->languages_fetcher = gtr_languages_fetcher_new ();
   gtk_widget_show (priv->languages_fetcher);
-  gtk_box_pack_start (GTK_BOX (fetcher_box), priv->languages_fetcher,
-                      TRUE, TRUE, 0);
+  gtk_widget_set_hexpand (priv->languages_fetcher, TRUE);
+  gtk_box_append (GTK_BOX (fetcher_box), priv->languages_fetcher);
 }
 
 static void
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 6a008052..e730bb61 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -1922,7 +1922,7 @@ gtr_tab_set_info_bar (GtrTab * tab, GtkWidget * infobar)
   if (infobar == NULL)
     return;
 
-  gtk_box_pack_start (GTK_BOX (tab), priv->infobar, FALSE, FALSE, 0);
+  gtk_box_append (GTK_BOX (tab), priv->infobar);
 
   g_object_add_weak_pointer (G_OBJECT (priv->infobar),
                              (gpointer *) & priv->infobar);
diff --git a/src/gtr-upload-dialog.c b/src/gtr-upload-dialog.c
index d59512b8..f2b46216 100644
--- a/src/gtr-upload-dialog.c
+++ b/src/gtr-upload-dialog.c
@@ -23,6 +23,7 @@
 #endif
 
 #include "gtr-upload-dialog.h"
+#include "gtr-utils.h"
 
 #include <string.h>
 #include <glib.h>
@@ -84,7 +85,7 @@ gtr_upload_dialog_init (GtrUploadDialog *dlg)
   priv->label = GTK_WIDGET (gtk_builder_get_object (builder, "label"));
   g_object_unref (builder);
 
-  gtk_box_pack_start (content_area, priv->main_box, FALSE, FALSE, 0);
+  gtk_box_append (content_area, priv->main_box);
 }
 
 GtrUploadDialog *
diff --git a/src/translation-memory/gtr-translation-memory-dialog.c 
b/src/translation-memory/gtr-translation-memory-dialog.c
index d4442150..a57c1917 100644
--- a/src/translation-memory/gtr-translation-memory-dialog.c
+++ b/src/translation-memory/gtr-translation-memory-dialog.c
@@ -19,6 +19,7 @@
 #include "gtr-profile-manager.h"
 #include "gtr-translation-memory-utils.h"
 #include "gtr-po.h"
+#include "gtr-utils.h"
 
 #include <glib/gi18n.h>
 
@@ -325,7 +326,8 @@ gtr_translation_memory_dialog_init (GtrTranslationMemoryDialog *dlg)
   priv->tm_lang_entry = GTK_WIDGET (gtk_builder_get_object (builder, "tm-lang-entry"));
   g_object_unref (builder);
 
-  gtk_box_pack_start (GTK_BOX (content_area), content, TRUE, TRUE, 0);
+  gtk_widget_set_vexpand (content, TRUE);
+  gtk_box_append (GTK_BOX (content_area), content);
   g_object_unref (content);
 
   prof_manager = gtr_profile_manager_get_default ();


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