summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-09 20:34:56 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-13 15:05:43 +0100
commitde1bef38ac1fb7e33bf3742200635870eb22ae2e (patch)
treeff1cfddb21fe1696c8634155cd8a84c7e6c44d18
parent930436556075111dc13d4c8d8d270a3c89a9cd13 (diff)
downloadcaja-de1bef38ac1fb7e33bf3742200635870eb22ae2e.tar.bz2
caja-de1bef38ac1fb7e33bf3742200635870eb22ae2e.tar.xz
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
-rw-r--r--eel/eel-editable-label.c18
1 files 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)