diff options
author | Timm Bäder <mail@baedert.org> | 2019-02-13 15:37:54 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2019-02-16 11:19:29 +0100 |
commit | 07393997665bfc677903a7fd405cda2ac9f5a49b (patch) | |
tree | 6ed32f8a557094c4214ff6518135ed59ef90d5f1 | |
parent | bea1a02edd161658f96f63c12694a8b3acce9c93 (diff) | |
download | gtk+-07393997665bfc677903a7fd405cda2ac9f5a49b.tar.gz |
paned: Implement increased handle area using pick()
Otherwise, we do report the widgets below the invisible handle area as
hovered or active.
-rw-r--r-- | gtk/gtkpaned.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index c4bb503e39..2cd216657e 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -326,6 +326,23 @@ gtk_paned_motion (GtkEventControllerMotion *motion, } } +static GtkWidget * +gtk_paned_pick (GtkWidget *widget, + double x, + double y) +{ + GtkPaned *paned = GTK_PANED (widget); + GtkPanedPrivate *priv = gtk_paned_get_instance_private (paned); + graphene_rect_t handle_area; + + get_handle_area (paned, &handle_area); + + if (graphene_rect_contains_point (&handle_area, &(graphene_point_t){x, y})) + return priv->handle_widget; + + return GTK_WIDGET_CLASS (gtk_paned_parent_class)->pick (widget, x, y); +} + static void gtk_paned_class_init (GtkPanedClass *class) { @@ -348,6 +365,7 @@ gtk_paned_class_init (GtkPanedClass *class) widget_class->size_allocate = gtk_paned_size_allocate; widget_class->unrealize = gtk_paned_unrealize; widget_class->focus = gtk_paned_focus; + widget_class->pick = gtk_paned_pick; container_class->add = gtk_paned_add; container_class->remove = gtk_paned_remove; |