From de1bef38ac1fb7e33bf3742200635870eb22ae2e Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Sat, 9 Jan 2016 20:34:56 +0100 Subject: GTK3 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. taken from: https://git.gnome.org/browse/nautilus/commit/?id=b143b95 --- eel/eel-editable-label.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c index 06948610..7414c19c 100644 --- a/eel/eel-editable-label.c +++ b/eel/eel-editable-label.c @@ -1754,17 +1754,15 @@ eel_editable_label_draw (GtkWidget *widget, if (label->draw_outline) { - GtkAllocation allocation; - GdkRGBA color; + gtk_style_context_save (style); + gtk_style_context_set_state (style, gtk_widget_get_state_flags (widget)); - 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_render_frame (style, cr, + 0, 0, + gtk_widget_get_allocated_width (widget), + gtk_widget_get_allocated_height (widget)); + + gtk_style_context_restore (style); #else eel_editable_label_expose (GtkWidget *widget, GdkEventExpose *event) -- cgit v1.2.1