[gnome-terminal/gnome-3-4] window: Handle GDK_SCROLL_SMOOTH
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal/gnome-3-4] window: Handle GDK_SCROLL_SMOOTH
- Date: Wed, 14 Mar 2012 20:52:31 +0000 (UTC)
commit 94bba3746882a62fec9ee737d40ed4469b3c5b89
Author: Christian Persch <chpe gnome org>
Date: Wed Mar 14 21:51:43 2012 +0100
window: Handle GDK_SCROLL_SMOOTH
src/terminal-window.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 3eb7d88..9c52781 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -3002,7 +3002,27 @@ notebook_scroll_event_cb (GtkWidget *widget,
case GDK_SCROLL_UP:
gtk_notebook_prev_page (notebook);
break;
- }
+#if GTK_CHECK_VERSION (3, 3, 17)
+ case GDK_SCROLL_SMOOTH:
+ switch (gtk_notebook_get_tab_pos (notebook)) {
+ case GTK_POS_LEFT:
+ case GTK_POS_RIGHT:
+ if (event->delta_x > 0)
+ gtk_notebook_next_page (notebook);
+ else if (event->delta_x < 0)
+ gtk_notebook_prev_page (notebook);
+ break;
+ case GTK_POS_TOP:
+ case GTK_POS_BOTTOM:
+ if (event->delta_y > 0)
+ gtk_notebook_next_page (notebook);
+ else if (event->delta_y < 0)
+ gtk_notebook_prev_page (notebook);
+ break;
+ }
+ break;
+#endif
+ }
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]