[gtksourceview] Completion: migrate the UI description to GtkGrid



commit 773a8885761383abb6006f29a6a44c5daa5201cb
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Tue Apr 24 15:27:57 2012 +0200

    Completion: migrate the UI description to GtkGrid
    
    The scrollbar policy is by default "automatic" in GTK+ 3.
    
    The first children of the GtkGrid's don't have packing properties
    because all the default values are OK for them.

 gtksourceview/gtksourcecompletion.c  |    8 +++---
 gtksourceview/gtksourcecompletion.ui |   44 ++++++++++++---------------------
 2 files changed, 20 insertions(+), 32 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 863775d..a0c58ac 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -113,7 +113,7 @@ struct _GtkSourceCompletionPrivate
 	GtkWidget *selection_label;
 	GtkWidget *default_info;
 	GtkWidget *selection_image;
-	GtkWidget *hbox_info;
+	GtkWidget *hgrid_info;
 	GtkWidget *label_info;
 	GtkWidget *image_info;
 	GtkTreeViewColumn *tree_view_column_accelerator;
@@ -2884,7 +2884,7 @@ info_button_style_updated (GtkWidget           *button,
 	                             "image-spacing", &spacing,
 	                             NULL);
 
-	gtk_box_set_spacing (GTK_BOX (completion->priv->hbox_info), spacing);
+	gtk_grid_set_column_spacing (GTK_GRID (completion->priv->hgrid_info), spacing);
 
 	settings = gtk_widget_get_settings (button);
 	g_object_get (settings,
@@ -2966,9 +2966,9 @@ initialize_ui (GtkSourceCompletion *completion)
 	completion->priv->image_info =
 		GTK_WIDGET (gtk_builder_get_object (builder,
 		                                    "image_info"));
-	completion->priv->hbox_info =
+	completion->priv->hgrid_info =
 		GTK_WIDGET (gtk_builder_get_object (builder,
-		                                    "hbox_info"));
+		                                    "hgrid_info"));
 
 	gtk_window_set_attached_to (GTK_WINDOW (completion->priv->window),
 				    GTK_WIDGET (completion->priv->view));
diff --git a/gtksourceview/gtksourcecompletion.ui b/gtksourceview/gtksourcecompletion.ui
index 5df235f..ea61f16 100644
--- a/gtksourceview/gtksourcecompletion.ui
+++ b/gtksourceview/gtksourcecompletion.ui
@@ -5,6 +5,7 @@ gtksourcecompletion.ui
 This file is part of GtkSourceView
 
 Copyright (C) 2009 - Jesse van den Kieboom <jessevdk gnome org>
+Copyright (C) 2012 - SÃbastien Wilmet <swilmet src gnome org>
 
 GtkSourceView is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -22,8 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 -->
 
 <interface>
-  <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy project-wide -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkWindow" id="window_completion">
     <property name="border_width">1</property>
     <property name="type">popup</property>
@@ -35,15 +35,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     <property name="focus_on_map">False</property>
     <property name="decorated">False</property>
     <child>
-      <object class="GtkBox" id="vbox_completion">
+      <object class="GtkGrid" id="vgrid_completion">
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <child>
           <object class="GtkScrolledWindow" id="scrolled_window_completion">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="hscrollbar_policy">automatic</property>
-            <property name="vscrollbar_policy">automatic</property>
             <child>
               <object class="GtkTreeView" id="tree_view_completion">
                 <property name="visible">True</property>
@@ -77,13 +75,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
               </object>
             </child>
           </object>
-          <packing>
-            <property name="position">0</property>
-          </packing>
         </child>
         <child>
-          <object class="GtkBox" id="hbox_bottom_bar">
+          <object class="GtkGrid" id="hgrid_bottom_bar">
             <property name="visible">True</property>
+            <property name="orientation">horizontal</property>
             <child>
               <object class="GtkToggleButton" id="toggle_button_info">
                 <property name="visible">True</property>
@@ -93,17 +89,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
                 <property name="focus_on_click">False</property>
                 <property name="relief">GTK_RELIEF_NONE</property>
                 <child>
-                  <object class="GtkBox" id="hbox_info">
+                  <object class="GtkGrid" id="hgrid_info">
                     <property name="visible">True</property>
-                    <property name="spacing">2</property>
+                    <property name="orientation">horizontal</property>
+                    <property name="column_spacing">2</property>
+                    <property name="valign">center</property>
                     <child>
                       <object class="GtkImage" id="image_info">
                         <property name="visible">True</property>
                         <property name="stock">gtk-info</property>
                       </object>
-                      <packing>
-                        <property name="position">0</property>
-                      </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label_info">
@@ -112,42 +107,35 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
                         <property name="use_underline">True</property>
                       </object>
                       <packing>
-                        <property name="position">1</property>
+                        <property name="left_attach">1</property>
                       </packing>
                     </child>
                   </object>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkImage" id="image_selection">
                 <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="hexpand">True</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="pack_type">end</property>
-                <property name="position">2</property>
+                <property name="left_attach">1</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label_selection">
                 <property name="visible">True</property>
+                <property name="margin">6</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="padding">6</property>
-                <property name="pack_type">end</property>
-                <property name="position">1</property>
+                <property name="left_attach">2</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="position">1</property>
+            <property name="top_attach">1</property>
           </packing>
         </child>
       </object>



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