[epiphany/wip/exalm/gtk4-cleanups-3: 4/9] Stop using GtkContainer:border-width




commit f714f8b51c39b29e18652b257c681d7872e4ffd9
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Dec 2 04:03:05 2021 +0500

    Stop using GtkContainer:border-width
    
    It's gone in GTK4, use margins.

 lib/widgets/ephy-certificate-dialog.c    |  5 ++++-
 src/resources/gtk/bookmark-properties.ui |  5 ++++-
 src/resources/gtk/bookmarks-popover.ui   |  5 ++++-
 src/resources/gtk/encoding-dialog.ui     | 10 ++++++++--
 src/resources/gtk/prefs-lang-dialog.ui   |  6 ++++--
 src/resources/gtk/synced-tabs-dialog.ui  |  5 ++++-
 src/window-commands.c                    | 26 +++++++++++++++++---------
 7 files changed, 45 insertions(+), 17 deletions(-)
---
diff --git a/lib/widgets/ephy-certificate-dialog.c b/lib/widgets/ephy-certificate-dialog.c
index 68597198f..30a1f2373 100644
--- a/lib/widgets/ephy-certificate-dialog.c
+++ b/lib/widgets/ephy-certificate-dialog.c
@@ -283,7 +283,6 @@ ephy_certificate_dialog_init (EphyCertificateDialog *dialog)
 
   gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 500);
 
-  gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
   gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
 
   grid = gtk_grid_new ();
@@ -316,6 +315,10 @@ ephy_certificate_dialog_init (EphyCertificateDialog *dialog)
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
   gtk_box_set_spacing (GTK_BOX (content_area), 14);
+  gtk_widget_set_margin_top (content_area, 10);
+  gtk_widget_set_margin_bottom (content_area, 10);
+  gtk_widget_set_margin_start (content_area, 10);
+  gtk_widget_set_margin_end (content_area, 10);
   gtk_box_pack_start (GTK_BOX (content_area), grid, FALSE, TRUE, 0);
   gtk_widget_show (grid);
 }
diff --git a/src/resources/gtk/bookmark-properties.ui b/src/resources/gtk/bookmark-properties.ui
index f13a04fb5..a89a90514 100644
--- a/src/resources/gtk/bookmark-properties.ui
+++ b/src/resources/gtk/bookmark-properties.ui
@@ -4,7 +4,10 @@
   <requires lib="gtk+" version="3.18"/>
   <template class="EphyBookmarkProperties" parent="GtkBox">
     <property name="visible">True</property>
-    <property name="border_width">12</property>
+    <property name="margin-top">12</property>
+    <property name="margin-bottom">12</property>
+    <property name="margin-start">12</property>
+    <property name="margin-end">12</property>
     <property name="orientation">vertical</property>
     <property name="spacing">6</property>
     <child>
diff --git a/src/resources/gtk/bookmarks-popover.ui b/src/resources/gtk/bookmarks-popover.ui
index 75a81790c..5925e0a47 100644
--- a/src/resources/gtk/bookmarks-popover.ui
+++ b/src/resources/gtk/bookmarks-popover.ui
@@ -4,7 +4,10 @@
   <template class="EphyBookmarksPopover" parent="GtkPopover">
     <child>
       <object class="GtkBox">
-        <property name="border-width">12</property>
+        <property name="margin-top">12</property>
+        <property name="margin-bottom">12</property>
+        <property name="margin-start">12</property>
+        <property name="margin-end">12</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
         <property name="visible">true</property>
diff --git a/src/resources/gtk/encoding-dialog.ui b/src/resources/gtk/encoding-dialog.ui
index 523b05d00..4924a1b79 100644
--- a/src/resources/gtk/encoding-dialog.ui
+++ b/src/resources/gtk/encoding-dialog.ui
@@ -3,7 +3,6 @@
 <interface>
   <requires lib="gtk+" version="3.14"/>
   <template class="EphyEncodingDialog" parent="GtkDialog">
-    <property name="border_width">6</property>
     <property name="title" translatable="yes">Text Encoding</property>
     <property name="role">epiphany-encoding-chooser</property>
     <property name="modal">True</property>
@@ -18,6 +17,10 @@
       <object class="GtkBox">
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
+        <property name="margin-top">6</property>
+        <property name="margin-bottom">6</property>
+        <property name="margin-start">6</property>
+        <property name="margin-end">6</property>
         <child internal-child="action_area">
           <object class="GtkButtonBox">
           </object>
@@ -105,7 +108,10 @@
                     <child>
                       <object class="GtkFrame">
                         <property name="visible">True</property>
-                        <property name="border_width">6</property>
+                        <property name="margin-top">6</property>
+                        <property name="margin-bottom">6</property>
+                        <property name="margin-start">6</property>
+                        <property name="margin-end">6</property>
                         <child>
                           <object class="GtkListBox" id="related_list_box">
                             <property name="visible">True</property>
diff --git a/src/resources/gtk/prefs-lang-dialog.ui b/src/resources/gtk/prefs-lang-dialog.ui
index b006eaf56..94aa0f973 100644
--- a/src/resources/gtk/prefs-lang-dialog.ui
+++ b/src/resources/gtk/prefs-lang-dialog.ui
@@ -2,7 +2,6 @@
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="add_language_dialog">
-    <property name="border_width">5</property>
     <property name="role">epiphany-preferences-add-language</property>
     <property name="destroy_with_parent">True</property>
     <property name="type_hint">dialog</property>
@@ -42,8 +41,11 @@
         <child>
           <object class="GtkBox" id="vbox198">
             <property name="visible">True</property>
-            <property name="border_width">5</property>
             <property name="orientation">vertical</property>
+            <property name="margin-top">10</property>
+            <property name="margin-bottom">10</property>
+            <property name="margin-start">10</property>
+            <property name="margin-end">10</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkLabel" id="label1309">
diff --git a/src/resources/gtk/synced-tabs-dialog.ui b/src/resources/gtk/synced-tabs-dialog.ui
index e59de2c28..9d1dcaf65 100644
--- a/src/resources/gtk/synced-tabs-dialog.ui
+++ b/src/resources/gtk/synced-tabs-dialog.ui
@@ -27,7 +27,10 @@
       <object class="GtkBox">
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
-        <property name="border_width">15</property>
+        <property name="margin-top">15</property>
+        <property name="margin-bottom">15</property>
+        <property name="margin-start">15</property>
+        <property name="margin-end">15</property>
         <property name="spacing">12</property>
         <child>
           <object class="GtkLabel">
diff --git a/src/window-commands.c b/src/window-commands.c
index 9edc8163e..d101f0d93 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -314,10 +314,14 @@ show_firefox_profile_selector (GtkWindow *parent,
   gtk_dialog_set_default_response (GTK_DIALOG (selector), GTK_RESPONSE_OK);
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (selector));
-  gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
   gtk_widget_set_valign (content_area, GTK_ALIGN_CENTER);
 
   list_box = gtk_list_box_new ();
+  gtk_widget_set_margin_top (list_box, 5);
+  gtk_widget_set_margin_bottom (list_box, 5);
+  gtk_widget_set_margin_start (list_box, 5);
+  gtk_widget_set_margin_end (list_box, 5);
+
   for (l = profiles; l != NULL; l = l->next) {
     const gchar *profile = l->data;
     GtkWidget *label;
@@ -552,9 +556,10 @@ window_cmd_import_bookmarks (GSimpleAction *action,
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
   gtk_widget_set_valign (content_area, GTK_ALIGN_CENTER);
-  gtk_widget_set_margin_start (content_area, 25);
-  gtk_widget_set_margin_end (content_area, 25);
-  gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
+  gtk_widget_set_margin_top (content_area, 5);
+  gtk_widget_set_margin_bottom (content_area, 5);
+  gtk_widget_set_margin_start (content_area, 30);
+  gtk_widget_set_margin_end (content_area, 30);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
 
@@ -793,9 +798,10 @@ window_cmd_import_passwords (GSimpleAction *action,
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
   gtk_widget_set_valign (content_area, GTK_ALIGN_CENTER);
-  gtk_widget_set_margin_start (content_area, 25);
-  gtk_widget_set_margin_end (content_area, 25);
-  gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
+  gtk_widget_set_margin_top (content_area, 5);
+  gtk_widget_set_margin_bottom (content_area, 5);
+  gtk_widget_set_margin_start (content_area, 30);
+  gtk_widget_set_margin_end (content_area, 30);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
 
@@ -1918,11 +1924,13 @@ window_cmd_save_as_application (GSimpleAction *action,
                                         NULL);
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
-  gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
 
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
+  gtk_widget_set_margin_top (box, 15);
+  gtk_widget_set_margin_bottom (box, 15);
+  gtk_widget_set_margin_start (box, 15);
+  gtk_widget_set_margin_end (box, 15);
   gtk_container_add (GTK_CONTAINER (content_area), box);
-  gtk_container_set_border_width (GTK_CONTAINER (box), 5);
 
   image = gtk_image_new ();
   gtk_widget_set_vexpand (image, TRUE);


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