[cheese] Avoid using deprecated GtkAlignment in main window



commit 7522ec013c8718c7bcac77fa57d6a9c1657114ac
Author: David King <amigadave amigadave com>
Date:   Wed Jul 23 13:48:58 2014 +0100

    Avoid using deprecated GtkAlignment in main window

 data/cheese-main-window.ui        |    8 +++-----
 src/cheese-window.vala            |    8 ++++----
 src/thumbview/cheese-thumb-view.c |    3 +++
 3 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/data/cheese-main-window.ui b/data/cheese-main-window.ui
index b8c1be2..0836797 100644
--- a/data/cheese-main-window.ui
+++ b/data/cheese-main-window.ui
@@ -28,7 +28,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkAlignment" id="action_area_alignment">
+              <object class="GtkBox" id="action_area_alignment">
                 <property name="hexpand">True</property>
                 <property name="visible">True</property>
                 <child>
@@ -186,9 +186,8 @@
           </object>
         </child>
         <child>
-          <object class="GtkAlignment" id="thumbnails_right">
+          <object class="GtkBox" id="thumbnails_right">
             <property name="visible">False</property>
-            <property name="vexpand">False</property>
             <child>
               <placeholder/>
             </child>
@@ -197,9 +196,8 @@
       </object>
     </child>
     <child>
-      <object class="GtkAlignment" id="thumbnails_bottom">
+      <object class="GtkBox" id="thumbnails_bottom">
         <property name="visible">False</property>
-        <property name="vexpand">False</property>
         <child>
           <placeholder/>
         </child>
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index a292714..90ad255 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -60,9 +60,9 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
     private Eog.ThumbNav thumb_nav;
     private Cheese.ThumbView thumb_view;
     [GtkChild]
-    private Gtk.Alignment thumbnails_right;
+    private Gtk.Box thumbnails_right;
     [GtkChild]
-    private Gtk.Alignment thumbnails_bottom;
+    private Gtk.Box thumbnails_bottom;
     [GtkChild]
     private Gtk.Widget leave_fullscreen_button_box;
     [GtkChild]
@@ -617,7 +617,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
     {
       thumb_view.set_vertical (true);
       thumb_nav.set_vertical (true);
-      if (thumbnails_bottom.get_child () != null)
+      if (thumbnails_bottom.get_children () != null)
       {
         thumbnails_bottom.remove (thumb_nav);
       }
@@ -633,7 +633,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
     {
       thumb_view.set_vertical (false);
       thumb_nav.set_vertical (false);
-      if (thumbnails_right.get_child () != null)
+      if (thumbnails_right.get_children () != null)
       {
         thumbnails_right.remove (thumb_nav);
       }
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index a427996..b5ce06b 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -782,6 +782,9 @@ cheese_thumb_view_set_vertical (CheeseThumbView *thumb_view, gboolean vertical)
     gtk_icon_view_set_columns(GTK_ICON_VIEW (thumb_view), priv->n_items);
   else
     gtk_icon_view_set_columns(GTK_ICON_VIEW (thumb_view), 1);
+
+  gtk_widget_set_hexpand (GTK_WIDGET (thumb_view), !vertical);
+  gtk_widget_set_vexpand (GTK_WIDGET (thumb_view), vertical);
 }
 
 void


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