gui: Properly load a pixbuf
Using gdk_pixbuf_new_from_file_at_scale() will load a scaled pixbuf, which looks better than loading a height x height square. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
9ef9b17b93
commit
dd66b10dfa
|
@ -1,5 +1,6 @@
|
|||
6.4.14:
|
||||
- Initialize track labels with the correct initial size
|
||||
- Initialize album part with the correct size
|
||||
- Gui spacing updates
|
||||
|
||||
6.4.15-rc:
|
||||
|
|
|
@ -31,9 +31,10 @@ static inline void __audio_set_time_label(const gchar *label, unsigned int time)
|
|||
static void __audio_set_cover(gchar *path)
|
||||
{
|
||||
GtkImage *image = GTK_IMAGE(gui_builder_widget("o_cover"));
|
||||
int height = gui_builder_widget_height("o_tags");
|
||||
GdkPixbuf *pix = gdk_pixbuf_new_from_file_at_size(path, height,
|
||||
height, NULL);
|
||||
int height = gui_builder_widget_height("o_tags") +
|
||||
gui_builder_widget_height("o_position") - 1;
|
||||
GdkPixbuf *pix = gdk_pixbuf_new_from_file_at_scale(path, -1, height,
|
||||
true, NULL);
|
||||
|
||||
gtk_image_set_from_pixbuf(image, pix);
|
||||
gtk_widget_show(GTK_WIDGET(image));
|
||||
|
|
|
@ -460,8 +460,6 @@
|
|||
<object class="GtkImage" id="o_cover">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">10</property>
|
||||
<property name="margin_right">10</property>
|
||||
<property name="icon_size">6</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
Loading…
Reference in New Issue