[gtk+/wip/scrolledwindow-overlay-on-captured] scrolledwindow: fade out scrollbars on leave notify
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/scrolledwindow-overlay-on-captured] scrolledwindow: fade out scrollbars on leave notify
- Date: Mon, 1 Dec 2014 13:55:01 +0000 (UTC)
commit 69c0de79389f88b89d2c081c6a4a1a8c03a8fe34
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Dec 1 13:37:18 2014 +0100
scrolledwindow: fade out scrollbars on leave notify
gtk/gtkscrolledwindow.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 1ccd4f2..da178f6 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -341,6 +341,9 @@ static gboolean maybe_hide_indicator (gpointer data);
static void indicator_start_fade (Indicator *indicator,
gdouble pos);
+static void indicator_set_over (Indicator *indicator,
+ gboolean over);
+
static guint signals[LAST_SIGNAL] = {0};
@@ -378,6 +381,20 @@ add_tab_bindings (GtkBindingSet *binding_set,
GTK_TYPE_DIRECTION_TYPE, direction);
}
+static gboolean
+gtk_scrolled_window_leave_notify (GtkWidget *widget,
+ GdkEventCrossing *event)
+{
+ GtkScrolledWindowPrivate *priv = GTK_SCROLLED_WINDOW (widget)->priv;
+
+ indicator_set_over (&priv->hindicator, FALSE);
+ indicator_start_fade (&priv->hindicator, 0.0);
+ indicator_set_over (&priv->vindicator, FALSE);
+ indicator_start_fade (&priv->vindicator, 0.0);
+
+ return GDK_EVENT_PROPAGATE;
+}
+
static void
gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
{
@@ -406,6 +423,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
widget_class->grab_notify = gtk_scrolled_window_grab_notify;
widget_class->realize = gtk_scrolled_window_realize;
widget_class->unrealize = gtk_scrolled_window_unrealize;
+ widget_class->leave_notify_event = gtk_scrolled_window_leave_notify;
container_class->add = gtk_scrolled_window_add;
container_class->remove = gtk_scrolled_window_remove;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]