After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735056 - Rating stars are not vertically aligned in GtkTreeView listing
Rating stars are not vertically aligned in GtkTreeView listing
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-19 13:46 UTC by gnome.vrb
Modified: 2014-08-23 01:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add 3 pixel of y offset to rating pixbufs (509 bytes, patch)
2014-08-19 13:51 UTC, gnome.vrb
needs-work Details | Review
UI with bigger font size (223.76 KB, image/png)
2014-08-20 04:36 UTC, gnome.vrb
  Details

Description gnome.vrb 2014-08-19 13:46:57 UTC
The ratings in song listings ( rb-entry-view through rb-rating-cell-renderer ) are not vertically aligned to center. They are more close to the top. This happens, since the rating pixbufs operate independently of the cell renderer's layout. rb-rating-cell-renderer uses cairo and pixel offset for rendering.

Due to this, gtk_cell_renderer_set_alignment( cell, 0.5, 0.5 ) has no effect on the alignment. The ratings are aligned properly in rb-rating widget though.
Comment 1 gnome.vrb 2014-08-19 13:47:53 UTC
Suggested fix is to add a few pixels to y_offset. 3 pixels of additional y offset makes the alignment proper.
Comment 2 gnome.vrb 2014-08-19 13:49:28 UTC
diff --git a/widgets/rb-cell-renderer-rating.c b/widgets/rb-cell-renderer-rating.c
index 45cb550..dc82fa4 100644
--- a/widgets/rb-cell-renderer-rating.c
+++ b/widgets/rb-cell-renderer-rating.c
@@ -287,7 +287,7 @@ rb_cell_renderer_rating_render (GtkCellRenderer  *cell,
        rb_rating_render_stars (widget, cr, cell_class->priv->pixbufs,
                                draw_rect.x - pix_rect.x,
                                draw_rect.y - pix_rect.y,
-                               draw_rect.x, draw_rect.y,
+                               draw_rect.x, draw_rect.y + 3,
                                cellrating->priv->rating, selected);
 }
Comment 3 gnome.vrb 2014-08-19 13:51:17 UTC
Created attachment 283891 [details] [review]
Add 3 pixel of y offset to rating pixbufs
Comment 4 Jonathan Matthew 2014-08-19 21:09:53 UTC
Does this work for all font sizes?  I think you'll have to do something smarter than this.
Comment 5 gnome.vrb 2014-08-20 04:36:01 UTC
Created attachment 283948 [details]
UI with bigger font size
Comment 6 Jonathan Matthew 2014-08-20 10:47:43 UTC
looks like you'll have to do something smarter than this.
Comment 7 Jonathan Matthew 2014-08-23 01:54:20 UTC
commit da6d318 does something smarter