[nautilus] editable-label: use gtk_render_frame() instead of hardcoding a stroke



commit b143b95f20755fc8425464aa11df3fa2ac2df2ea
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Oct 17 18:46:35 2011 -0400

    editable-label: use gtk_render_frame() instead of hardcoding a stroke
    
    This allows the stroke to use rounded corners and border images, among
    other things.

 eel/eel-editable-label.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 11e89a4..5492d1d 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1619,17 +1619,15 @@ eel_editable_label_draw (GtkWidget *widget,
 	eel_editable_label_draw_cursor (label, cr, x, y);
 
       if (label->draw_outline) {
-        GtkAllocation allocation;
-        GdkRGBA color;
-
-        gtk_widget_get_allocation (widget, &allocation);
-        gtk_style_context_get_color (style, gtk_widget_get_state_flags (widget), &color);
-	gdk_cairo_set_source_rgba (cr, &color);
-	cairo_set_line_width (cr, 1.0);
-	cairo_rectangle (cr, 0.5, 0.5, 
-			 allocation.width - 1,
-			 allocation.height - 1);
-	cairo_stroke (cr);
+        gtk_style_context_save (style);
+        gtk_style_context_set_state (style, gtk_widget_get_state_flags (widget));
+
+        gtk_render_frame (style, cr,
+                          0, 0,
+                          gtk_widget_get_allocated_width (widget),
+                          gtk_widget_get_allocated_height (widget));
+
+        gtk_style_context_restore (style);
       }
     }
 



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