[rhythmbox] podcast: set fixed size on pixbuf renderer in podcast add dialog



commit 7fc02185582445b6820d645c8349851427a82084
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Oct 15 17:23:29 2020 +1000

    podcast: set fixed size on pixbuf renderer in podcast add dialog
    
    This stops the search results jumping around as the images load, and
    makes the layout consistent when non-square images appear.

 podcast/rb-podcast-add-dialog.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/podcast/rb-podcast-add-dialog.c b/podcast/rb-podcast-add-dialog.c
index ef9488459..e7befa45f 100644
--- a/podcast/rb-podcast-add-dialog.c
+++ b/podcast/rb-podcast-add-dialog.c
@@ -690,6 +690,7 @@ impl_constructed (GObject *object)
        RhythmDBQuery *query;
        RhythmDBQueryModel *query_model;
        const char *episode_strings[3];
+       int xpad, ypad;
 
        RB_CHAIN_GOBJECT_METHOD (rb_podcast_add_dialog_parent_class, constructed, object);
        dialog = RB_PODCAST_ADD_DIALOG (object);
@@ -741,7 +742,11 @@ impl_constructed (GObject *object)
                                                       G_TYPE_ULONG);   /* date */
        gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->priv->feed_view), GTK_TREE_MODEL 
(dialog->priv->feed_model));
 
-       column = gtk_tree_view_column_new_with_attributes (_("Title"), gtk_cell_renderer_pixbuf_new (), 
"pixbuf", FEED_COLUMN_IMAGE, NULL);
+       renderer = gtk_cell_renderer_pixbuf_new ();
+       gtk_cell_renderer_get_padding (renderer, &xpad, &ypad);
+       gtk_cell_renderer_set_fixed_size (renderer, PODCAST_IMAGE_SIZE + (xpad * 2), PODCAST_IMAGE_SIZE + 
(ypad * 2));
+
+       column = gtk_tree_view_column_new_with_attributes (_("Title"), renderer, "pixbuf", FEED_COLUMN_IMAGE, 
NULL);
        renderer = gtk_cell_renderer_text_new ();
        g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
        gtk_tree_view_column_pack_start (column, renderer, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]