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
=== modified file 'src/metadata-widget.c'
--- src/metadata-widget.c 2011-01-27 03:30:55 +0000
+++ src/metadata-widget.c 2011-04-16 18:22:25 +0000
@@ -106,8 +106,7 @@
106 106
107 g_signal_connect(priv->album_art, "expose-event", 107 g_signal_connect(priv->album_art, "expose-event",
108 G_CALLBACK(metadata_image_expose),108 G_CALLBACK(metadata_image_expose),
109 GTK_WIDGET(self)); 109 GTK_WIDGET(self));
110 gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
111 110
112 gtk_box_pack_start (GTK_BOX (priv->hbox),111 gtk_box_pack_start (GTK_BOX (priv->hbox),
113 priv->album_art,112 priv->album_art,
@@ -190,26 +189,29 @@
190 if(g_string_equal(priv->image_path, priv->old_image_path) == FALSE ||189 if(g_string_equal(priv->image_path, priv->old_image_path) == FALSE ||
191 priv->theme_change_occured == TRUE){190 priv->theme_change_occured == TRUE){
192 priv->theme_change_occured = FALSE; 191 priv->theme_change_occured = FALSE;
193 GdkPixbuf* orig_pixbuf;192 GdkPixbuf* pixbuf;
194 orig_pixbuf = gdk_pixbuf_new_from_file(priv->image_path->str, NULL);193 pixbuf = gdk_pixbuf_new_from_file_at_size(priv->image_path->str, 60, 60, NULL);
195 //g_debug("metadata_load_new_image -> pixbuf from %s",194 //g_debug("metadata_load_new_image -> pixbuf from %s",
196 // priv->image_path->str); 195 // priv->image_path->str);
197 if(GDK_IS_PIXBUF(orig_pixbuf) == FALSE){196 if(GDK_IS_PIXBUF(pixbuf) == FALSE){
198 //g_debug("problem loading the downloaded image just use the placeholder instead");197 //g_debug("problem loading the downloaded image just use the placeholder instead");
198 gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
199 draw_album_art_placeholder(metadata);199 draw_album_art_placeholder(metadata);
200 return TRUE;200 return TRUE;
201 }201 }
202 GdkPixbuf* pixbuf;
203 pixbuf = gdk_pixbuf_scale_simple(orig_pixbuf,60, 60, GDK_INTERP_BILINEAR);
204 gtk_image_set_from_pixbuf(GTK_IMAGE(priv->album_art), pixbuf);202 gtk_image_set_from_pixbuf(GTK_IMAGE(priv->album_art), pixbuf);
203 gtk_widget_set_size_request(GTK_WIDGET(priv->album_art),
204 gdk_pixbuf_get_width(pixbuf),
205 gdk_pixbuf_get_height(pixbuf));
206
205 g_string_erase(priv->old_image_path, 0, -1);207 g_string_erase(priv->old_image_path, 0, -1);
206 g_string_overwrite(priv->old_image_path, 0, priv->image_path->str);208 g_string_overwrite(priv->old_image_path, 0, priv->image_path->str);
207209
208 g_object_unref(pixbuf); 210 g_object_unref(pixbuf);
209 g_object_unref(orig_pixbuf);
210 }211 }
211 return FALSE; 212 return FALSE;
212 }213 }
214 gtk_widget_set_size_request(GTK_WIDGET(priv->album_art), 60, 60);
213 draw_album_art_placeholder(metadata);215 draw_album_art_placeholder(metadata);
214 return TRUE;216 return TRUE;
215}217}

Subscribers

People subscribed via source and target branches