[gtk+/wip/baedert/drawing: 10/359] widget: Draw focus outline



commit 98642c02e1f5e8d5f73b29b362cd6ada67e1bf9b
Author: Timm Bäder <mail baedert org>
Date:   Wed May 3 10:24:32 2017 +0200

    widget: Draw focus outline

 gtk/gtkwidget.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 2e5203f..39c5498 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15415,6 +15415,16 @@ gtk_widget_snapshot (GtkWidget   *widget,
         gtk_snapshot_pop (snapshot);
     }
 
+  if (gtk_widget_has_visible_focus (widget))
+    {
+      gtk_snapshot_offset (snapshot, margin.left, margin.top);
+      gtk_css_style_snapshot_outline (style,
+                                      snapshot,
+                                      allocation.width - margin.left - margin.right,
+                                      allocation.height - margin.top - margin.bottom);
+      gtk_snapshot_offset (snapshot, - margin.left, - margin.top);
+    }
+
   gtk_css_filter_value_pop_snapshot (filter_value, snapshot);
 
   if (GTK_DEBUG_CHECK (SNAPSHOT))


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