[rhythmbox] cell-renderer-rating: vertically align the rating stars



commit da6d31817a47573cdb4bb41e8ce3dc008d3a4ee7
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Aug 23 11:53:21 2014 +1000

    cell-renderer-rating: vertically align the rating stars
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735056

 widgets/rb-cell-renderer-rating.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/widgets/rb-cell-renderer-rating.c b/widgets/rb-cell-renderer-rating.c
index 45cb550..2043a8a 100644
--- a/widgets/rb-cell-renderer-rating.c
+++ b/widgets/rb-cell-renderer-rating.c
@@ -232,22 +232,25 @@ rb_cell_renderer_rating_get_size (GtkCellRenderer *cell,
 {
        gint icon_width;
        gint xpad, ypad;
+       int h;
        RBCellRendererRating *cellrating = (RBCellRendererRating *) cell;
 
        gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &icon_width, NULL);
        gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (cellrating), &xpad, &ypad);
 
+       h = ypad * 2 + icon_width;
+
        if (x_offset)
                *x_offset = 0;
 
        if (y_offset)
-               *y_offset = 0;
+               *y_offset = ((cell_area->height + 1) - h) / 2;
 
        if (width)
                *width = xpad * 2 + icon_width * RB_RATING_MAX_SCORE;
 
        if (height)
-               *height = ypad * 2 + icon_width;
+               *height = h;
 }
 
 static void


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