aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-07-16 15:40:42 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-07-16 15:40:42 +0200
commit1a211d63c3c6282a03274d600f12292939fa57ca (patch)
tree14346170c28868685a2f22f8220b937f91f14e06 /tools
parent515f71772aabb6537a6549ebe4ed24d52a3ffdf9 (diff)
downloadlibayatana-indicator-1a211d63c3c6282a03274d600f12292939fa57ca.tar.gz
libayatana-indicator-1a211d63c3c6282a03274d600f12292939fa57ca.tar.bz2
libayatana-indicator-1a211d63c3c6282a03274d600f12292939fa57ca.zip
IndicatorLoader: convert gtk scroll events to indicator object events
They actually match, but just for safety...
Diffstat (limited to 'tools')
-rw-r--r--tools/indicator-loader.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c
index 8fee29b..a734b8a 100644
--- a/tools/indicator-loader.c
+++ b/tools/indicator-loader.c
@@ -63,16 +63,39 @@ scroll_entry (GtkWidget *widget, GdkEventScroll* event, gpointer user_data)
g_return_if_fail (INDICATOR_IS_OBJECT(user_data));
entry = g_object_get_qdata (G_OBJECT(widget), entry_data_quark());
+ IndicatorScrollDirection direction = G_MAXINT;
+
+ switch (event->direction)
+ {
+ case GDK_SCROLL_UP:
+ direction = INDICATOR_OBJECT_SCROLL_UP;
+ break;
+ case GDK_SCROLL_DOWN:
+ direction = INDICATOR_OBJECT_SCROLL_DOWN;
+ break;
+ case GDK_SCROLL_LEFT:
+ direction = INDICATOR_OBJECT_SCROLL_LEFT;
+ break;
+ case GDK_SCROLL_RIGHT:
+ direction = INDICATOR_OBJECT_SCROLL_RIGHT;
+ break;
+ default:
+ break;
+ }
if (entry == NULL)
{
g_debug("Scroll on: (null)");
}
+ else if (direction == G_MAXINT)
+ {
+ g_debug("Scroll direction not supported");
+ }
else
{
g_signal_emit_by_name(INDICATOR_OBJECT(user_data),
INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED,
- entry, 1, event->direction);
+ entry, 1, direction);
}
}