[gnome-terminal] prefs: Fixup dialogue padding alignment



commit 1019050de3831f1dd69f4af669febabda0a0d38b
Author: Christian Persch <chpe gnome org>
Date:   Tue Mar 3 20:28:16 2015 +0100

    prefs: Fixup dialogue padding alignment
    
    Not going to be fixed in gtk+, so work around this here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735242

 src/find-dialog.ui         |    2 +-
 src/preferences.ui         |    4 ++--
 src/profile-editor.c       |    7 +++++++
 src/profile-preferences.ui |    4 ++--
 src/terminal-util.c        |   10 ++++++++++
 5 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/src/find-dialog.ui b/src/find-dialog.ui
index e23bbb5..8692e5d 100644
--- a/src/find-dialog.ui
+++ b/src/find-dialog.ui
@@ -17,7 +17,7 @@
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child internal-child="action_area">
-          <object class="GtkButtonBox" id="hbuttonbox2">
+          <object class="GtkButtonBox" id="dialog-action-area">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
diff --git a/src/preferences.ui b/src/preferences.ui
index f64a11b..d12132b 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -23,7 +23,7 @@
     <property name="border_width">5</property>
     <property name="title" translatable="yes">Preferences</property>
     <property name="role">gnome-terminal-accels</property>
-    <property name="type_hint">dialog</property>
+    <property name="type_hint">normal</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox2">
         <property name="visible">True</property>
@@ -31,7 +31,7 @@
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area2">
+          <object class="GtkButtonBox" id="dialog-action-area">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index ca53175..3e8ccaf 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -798,6 +798,13 @@ terminal_profile_edit (GSettings  *profile,
   g_object_set_data_full (G_OBJECT (editor), "builder",
                           builder, (GDestroyNotify) g_object_unref);
 
+  /* Fixup dialogue padding, #735242 */
+  w = (GtkWidget *) gtk_builder_get_object (builder, "dialog-action-area");
+  gtk_widget_set_margin_left   (w, 5);
+  gtk_widget_set_margin_right  (w, 5);
+  gtk_widget_set_margin_top    (w, 5);
+  gtk_widget_set_margin_bottom (w, 5);
+
   /* Store the dialogue on the profile, so we can acccess it above to check if
    * there's already a profile editor for this profile.
    */
diff --git a/src/profile-preferences.ui b/src/profile-preferences.ui
index 488e777..eb2fa26 100644
--- a/src/profile-preferences.ui
+++ b/src/profile-preferences.ui
@@ -151,7 +151,7 @@
     <property name="role">gnome-terminal-profile-editor</property>
     <property name="resizable">False</property>
     <property name="destroy_with_parent">True</property>
-    <property name="type_hint">dialog</property>
+    <property name="type_hint">normal</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="visible">True</property>
@@ -159,7 +159,7 @@
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area1">
+          <object class="GtkButtonBox" id="dialog-action-area">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 90fcb15..f999e2c 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -430,10 +430,20 @@ terminal_util_load_builder_resource (const char *path,
 
   if (main_object_name) {
     GObject *main_object;
+    GtkWidget *action_area;
 
     main_object = gtk_builder_get_object (builder, main_object_name);
     g_object_set_data_full (main_object, "builder", g_object_ref (builder), (GDestroyNotify) g_object_unref);
     g_signal_connect (main_object, "destroy", G_CALLBACK (main_object_destroy_cb), NULL);
+
+    /* Fixup dialogue padding, #735242 */
+    if (GTK_IS_DIALOG (main_object) &&
+        (action_area = (GtkWidget *) gtk_builder_get_object (builder, "dialog-action-area"))) {
+      gtk_widget_set_margin_left   (action_area, 5);
+      gtk_widget_set_margin_right  (action_area, 5);
+      gtk_widget_set_margin_top    (action_area, 5);
+      gtk_widget_set_margin_bottom (action_area, 5);
+    }
   }
 }
 


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