[Xfce4-commits] <parole:master> Set minimum width to accomodate controls, adjust minimum height to accomodate coverart

Sean Davis noreply at xfce.org
Fri Oct 11 11:52:53 CEST 2013


Updating branch refs/heads/master
         to 3988db6ec1d2182321707b55a9d265c19ecc82bf (commit)
       from 9a8bb2e1f24084e0fb2b039cf90abcd9bd5658dd (commit)

commit 3988db6ec1d2182321707b55a9d265c19ecc82bf
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Fri Oct 4 21:40:32 2013 -0400

    Set minimum width to accomodate controls, adjust minimum height to accomodate coverart

 data/interfaces/parole.ui |   24 ++++++++++++------------
 src/parole-player.c       |   30 ++++++++++++------------------
 2 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/data/interfaces/parole.ui b/data/interfaces/parole.ui
index f78c67f..007d497 100644
--- a/data/interfaces/parole.ui
+++ b/data/interfaces/parole.ui
@@ -6,11 +6,11 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkImage" id="image_about">
+  <object class="GtkImage" id="image_help_reportbug">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="pixel_size">16</property>
-    <property name="icon_name">gtk-about-symbolic</property>
+    <property name="icon_name">face-sick-symbolic</property>
     <property name="use_fallback">True</property>
   </object>
   <object class="GtkImage" id="image_disc">
@@ -20,13 +20,6 @@
     <property name="icon_name">media-optical-symbolic</property>
     <property name="use_fallback">True</property>
   </object>
-  <object class="GtkImage" id="image_help_reportbug">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="pixel_size">16</property>
-    <property name="icon_name">face-sick-symbolic</property>
-    <property name="use_fallback">True</property>
-  </object>
   <object class="GtkImage" id="image_media_fullscreen">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -55,6 +48,13 @@
     <property name="icon_name">media-skip-backward-symbolic</property>
     <property name="use_fallback">True</property>
   </object>
+  <object class="GtkImage" id="image_about">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="pixel_size">16</property>
+    <property name="icon_name">gtk-about-symbolic</property>
+    <property name="use_fallback">True</property>
+  </object>
   <object class="GtkImage" id="image_menu_fullscreen">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -422,8 +422,8 @@
                         <property name="use_underline">True</property>
                         <property name="image">image_volume_up</property>
                         <property name="use_stock">False</property>
-                        <accelerator key="equal" signal="activate"/>
                         <accelerator key="plus" signal="activate"/>
+                        <accelerator key="equal" signal="activate"/>
                         <signal name="activate" handler="parole_player_volume_up" swapped="no"/>
                       </object>
                     </child>
@@ -718,8 +718,8 @@
                 </child>
                 <child>
                   <object class="GtkEventBox" id="content_area">
-                    <property name="width_request">128</property>
-                    <property name="height_request">128</property>
+                    <property name="width_request">380</property>
+                    <property name="height_request">256</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <signal name="button-press-event" handler="parole_player_gst_widget_button_press" swapped="no"/>
diff --git a/src/parole-player.c b/src/parole-player.c
index 506dd06..26da795 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -2702,37 +2702,31 @@ parole_overlay_expose_event (GtkWidget *widget, cairo_t *cr, gpointer user_data)
     return FALSE;
 }
 
+/* This function allows smoothly adjusting the window alignment with coverart */
 static gboolean
 parole_audiobox_expose_event (GtkWidget *w, GdkEventExpose *ev, ParolePlayer *player)
 {
     GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
     gboolean homogeneous;
+    
+    /* Float the cover and text together in the middle if there is space */
     gtk_widget_get_allocation(w, allocation);
     homogeneous = allocation->width > 536;
     g_free(allocation);
     
+    /* Nothing to do if the homogeneous setting is already good */
     if ( gtk_box_get_homogeneous( GTK_BOX(w) ) == homogeneous )
         return FALSE;
     
     gtk_box_set_homogeneous( GTK_BOX(w), homogeneous );
-    if (homogeneous)
-    {
-        gtk_box_set_child_packing (GTK_BOX(w),
-                                   player->priv->audiobox_cover,
-                                   TRUE,
-                                   TRUE,
-                                   0,
-                                   GTK_PACK_START);
-    }
-    else
-    {
-        gtk_box_set_child_packing (GTK_BOX(w),
-                                   player->priv->audiobox_cover,
-                                   FALSE,
-                                   TRUE,
-                                   0,
-                                   GTK_PACK_START);
-    }
+    
+    /* Expand the coverart if the parent box packing is homogenous */
+    gtk_box_set_child_packing (GTK_BOX(w),
+                               player->priv->audiobox_cover,
+                               homogeneous,
+                               TRUE,
+                               0,
+                               GTK_PACK_START);
 
     return FALSE;
 }


More information about the Xfce4-commits mailing list