[rhythmbox/gobject-introspection: 38/41] attempt at fixing rating widget rendering, kinda looks okay now
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox/gobject-introspection: 38/41] attempt at fixing rating widget rendering, kinda looks okay now
- Date: Sun, 12 Dec 2010 10:01:20 +0000 (UTC)
commit 0e77e45b00671abd8c07a3e9c1c6f55b3d04e513
Author: Jonathan Matthew <jonathan d14n org>
Date: Sun Dec 12 17:21:00 2010 +1000
attempt at fixing rating widget rendering, kinda looks okay now
widgets/rb-rating.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/widgets/rb-rating.c b/widgets/rb-rating.c
index afd151b..d8857d1 100644
--- a/widgets/rb-rating.c
+++ b/widgets/rb-rating.c
@@ -370,7 +370,6 @@ rb_rating_draw (GtkWidget *widget, cairo_t *cr)
int y = 0;
int width;
int height;
- int focus_width;
g_return_val_if_fail (RB_IS_RATING (widget), FALSE);
@@ -381,15 +380,6 @@ rb_rating_draw (GtkWidget *widget, cairo_t *cr)
width = gdk_window_get_width (window);
height = gdk_window_get_height (window);
- gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
- if (gtk_widget_has_focus (widget)) {
- x += focus_width;
- y += focus_width;
- width -= 2 * focus_width;
- height -= 2 * focus_width;
- }
-
- /* need to set state? shadow type? */
gtk_render_background (gtk_widget_get_style_context (widget),
cr,
x, y,
@@ -399,6 +389,21 @@ rb_rating_draw (GtkWidget *widget, cairo_t *cr)
x, y,
width, height);
+ if (gtk_widget_has_focus (widget)) {
+ int focus_width;
+ gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
+
+ x += focus_width;
+ y += focus_width;
+ width -= 2 * focus_width;
+ height -= 2 * focus_width;
+
+ gtk_render_focus (gtk_widget_get_style_context (widget),
+ cr,
+ x, y,
+ width, height);
+ }
+
/* draw the stars */
if (rating->priv->pixbufs != NULL) {
ret = rb_rating_render_stars (widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]