Merge lp:~malizor/indicator-sound/fix-654196 into lp:~indicator-applet-developers/indicator-sound/trunk_3

Proposed by Nicolas Delvaux
Status: Merged
Merge reported by: Charles Kerr
Merged at revision: not available
Proposed branch: lp:~malizor/indicator-sound/fix-654196
Merge into: lp:~indicator-applet-developers/indicator-sound/trunk_3
Diff against target: 50 lines (+11/-9)
1 file modified
src/metadata-widget.c (+11/-9)
To merge this branch: bzr merge lp:~malizor/indicator-sound/fix-654196
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+58008@code.launchpad.net

Description of the change

This fixes bug 654196, where the sound menu didn't keep the original album art ratio.
Of course, to test (and to notice the difference) you will have to use an album cover with a non-standard size/ratio :-)

To post a comment you must log in.
239. By Nicolas Delvaux

Fix a regression when calling "draw_album_art_placeholder" after diplaying one of those famous non-square cover.

Revision history for this message
Conor Curran (cjcurran) wrote :

Tentatively looks good, much tidier than my attempt :)
Will test tomorrow hopefully and get into Natty for next week.

Revision history for this message
Conor Curran (cjcurran) :
review: Approve
Revision history for this message
Nicolas Delvaux (malizor) wrote :

To be honest, I noticed that this only fix half of the original bug.

The case when the cover is "taller than wide" works (ie the display box now adapt its width) but, for an unknown reason, it does not work the other way around: I tried several things but the height seems to be fixed.

Well, this is still better with this patch than without it, but it would be cool if someone could find where the remaining problem is.

Revision history for this message
Charles Kerr (charlesk) wrote :

This appears to be a dead merge proposal that never got closed... marking as "merged"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/metadata-widget.c'
2--- src/metadata-widget.c 2011-01-27 03:30:55 +0000
3+++ src/metadata-widget.c 2011-04-16 18:22:25 +0000
4@@ -106,8 +106,7 @@
5
6 g_signal_connect(priv->album_art, "expose-event",
7 G_CALLBACK(metadata_image_expose),
8- GTK_WIDGET(self));
9- gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
10+ GTK_WIDGET(self));
11
12 gtk_box_pack_start (GTK_BOX (priv->hbox),
13 priv->album_art,
14@@ -190,26 +189,29 @@
15 if(g_string_equal(priv->image_path, priv->old_image_path) == FALSE ||
16 priv->theme_change_occured == TRUE){
17 priv->theme_change_occured = FALSE;
18- GdkPixbuf* orig_pixbuf;
19- orig_pixbuf = gdk_pixbuf_new_from_file(priv->image_path->str, NULL);
20+ GdkPixbuf* pixbuf;
21+ pixbuf = gdk_pixbuf_new_from_file_at_size(priv->image_path->str, 60, 60, NULL);
22 //g_debug("metadata_load_new_image -> pixbuf from %s",
23 // priv->image_path->str);
24- if(GDK_IS_PIXBUF(orig_pixbuf) == FALSE){
25+ if(GDK_IS_PIXBUF(pixbuf) == FALSE){
26 //g_debug("problem loading the downloaded image just use the placeholder instead");
27+ gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
28 draw_album_art_placeholder(metadata);
29 return TRUE;
30 }
31- GdkPixbuf* pixbuf;
32- pixbuf = gdk_pixbuf_scale_simple(orig_pixbuf,60, 60, GDK_INTERP_BILINEAR);
33 gtk_image_set_from_pixbuf(GTK_IMAGE(priv->album_art), pixbuf);
34+ gtk_widget_set_size_request(GTK_WIDGET(priv->album_art),
35+ gdk_pixbuf_get_width(pixbuf),
36+ gdk_pixbuf_get_height(pixbuf));
37+
38 g_string_erase(priv->old_image_path, 0, -1);
39 g_string_overwrite(priv->old_image_path, 0, priv->image_path->str);
40
41- g_object_unref(pixbuf);
42- g_object_unref(orig_pixbuf);
43+ g_object_unref(pixbuf);
44 }
45 return FALSE;
46 }
47+ gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
48 draw_album_art_placeholder(metadata);
49 return TRUE;
50 }

Subscribers

People subscribed via source and target branches