From 87422f8fa6face6715761ab76aeb04225f5ac235 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Wed, 22 Feb 2012 15:55:25 -0500 Subject: Import upstream version 0.8.2.0 --- src/metadata-widget.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/metadata-widget.c') diff --git a/src/metadata-widget.c b/src/metadata-widget.c index a3383df..36b48f8 100644 --- a/src/metadata-widget.c +++ b/src/metadata-widget.c @@ -129,13 +129,13 @@ metadata_widget_init (MetadataWidget *self) priv->icon_buf = NULL; #if GTK_CHECK_VERSION(3, 0, 0) - outer_v_box = gtk_box_new (FALSE, 0); + outer_v_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); #else outer_v_box = gtk_vbox_new (FALSE, 0); #endif #if GTK_CHECK_VERSION(3, 0, 0) - hbox = gtk_box_new(FALSE, 0); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); #else hbox = gtk_hbox_new(FALSE, 0); #endif @@ -174,7 +174,7 @@ metadata_widget_init (MetadataWidget *self) priv->theme_change_occured = FALSE; #if GTK_CHECK_VERSION(3, 0, 0) - GtkWidget* vbox = gtk_box_new(FALSE, 0); + GtkWidget* vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); #else GtkWidget* vbox = gtk_vbox_new(FALSE, 0); #endif @@ -227,16 +227,15 @@ metadata_widget_init (MetadataWidget *self) // player label GtkWidget* player_label; - player_label = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(player_label), (gfloat)0, (gfloat)0.5); - gtk_misc_set_padding (GTK_MISC(player_label), (gfloat)1, (gfloat)0); - gtk_widget_set_size_request (player_label, 200, 24); + player_label = gtk_label_new (""); + gtk_misc_set_alignment(GTK_MISC(player_label), (gfloat)0, (gfloat)0); + gtk_misc_set_padding (GTK_MISC(player_label), (gfloat)1, (gfloat)0); + gtk_widget_set_size_request (player_label, 150, 24); priv->player_label = player_label; gtk_box_pack_start (GTK_BOX(outer_v_box), priv->player_label, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX(outer_v_box), priv->meta_data_h_box, FALSE, FALSE, 0); - + gtk_container_add (GTK_CONTAINER (self), outer_v_box); gtk_widget_show_all (priv->meta_data_h_box); @@ -282,7 +281,7 @@ metadata_widget_get_preferred_width (GtkWidget* self, } /** * We override the expose method to enable primitive drawing of the - * empty album art image and rounded rectangles on the album art. + * empty album art image. */ static gboolean metadata_image_expose_gtk_3 (GtkWidget *metadata, @@ -299,8 +298,6 @@ metadata_image_expose_gtk_3 (GtkWidget *metadata, return FALSE; } - draw_album_border (metadata, FALSE); - if(priv->image_path->len > 0){ if(g_string_equal(priv->image_path, priv->old_image_path) == FALSE || priv->theme_change_occured == TRUE){ @@ -311,6 +308,7 @@ metadata_image_expose_gtk_3 (GtkWidget *metadata, if(GDK_IS_PIXBUF(pixbuf) == FALSE){ gtk_image_clear ( GTK_IMAGE(priv->album_art)); gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60); + draw_album_border (metadata, FALSE); draw_album_art_placeholder(metadata); return FALSE; } @@ -320,6 +318,7 @@ metadata_image_expose_gtk_3 (GtkWidget *metadata, gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf)); + draw_album_border (metadata, FALSE); g_string_erase (priv->old_image_path, 0, -1); g_string_overwrite (priv->old_image_path, 0, priv->image_path->str); g_object_unref(pixbuf); @@ -328,6 +327,7 @@ metadata_image_expose_gtk_3 (GtkWidget *metadata, } gtk_image_clear (GTK_IMAGE(priv->album_art)); gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60); + draw_album_border (metadata, FALSE); draw_album_art_placeholder(metadata); return FALSE; } @@ -500,7 +500,8 @@ metadata_widget_icon_triangle_draw_cb (GtkWidget *widget, #endif static void -draw_album_border(GtkWidget *metadata, gboolean selected) +draw_album_border(GtkWidget *metadata, + gboolean selected) { cairo_t *cr; cr = gdk_cairo_create (gtk_widget_get_window (metadata)); -- cgit v1.2.3