[planner] Allow scrolling in Gantt timeline and resource usage (fixes #604355)
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner] Allow scrolling in Gantt timeline and resource usage (fixes #604355)
- Date: Mon, 18 Oct 2010 15:25:25 +0000 (UTC)
commit 170f10cfdcd806abcc7861f8e1757370d62e06e3
Author: Caolan McNamara <caolanm redhat com>
Date: Mon Oct 18 16:57:50 2010 +0200
Allow scrolling in Gantt timeline and resource usage (fixes #604355)
src/planner-gantt-view.c | 5 ++++-
src/planner-usage-view.c | 6 +++++-
2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/planner-gantt-view.c b/src/planner-gantt-view.c
index e031c74..8d47944 100644
--- a/src/planner-gantt-view.c
+++ b/src/planner-gantt-view.c
@@ -205,6 +205,7 @@ G_DEFINE_TYPE (PlannerGanttView, planner_gantt_view, PLANNER_TYPE_VIEW);
static gboolean
gantt_view_chart_scroll_event (GtkWidget * gki, GdkEventScroll * event, PlannerGanttView *view)
{
+ gboolean dontpropagate = FALSE;
gboolean can_in, can_out;
PlannerGanttViewPriv *priv;
@@ -213,11 +214,13 @@ gantt_view_chart_scroll_event (GtkWidget * gki, GdkEventScroll * event, PlannerG
planner_gantt_chart_can_zoom (PLANNER_GANTT_CHART (priv->gantt), &can_in, &can_out);
switch (event->direction) {
case GDK_SCROLL_UP: {
+ dontpropagate = TRUE;
if (can_in)
gantt_view_zoom_in_cb (NULL, view);
break;
}
case GDK_SCROLL_DOWN:
+ dontpropagate = TRUE;
if (can_out)
gantt_view_zoom_out_cb (NULL, view);
break;
@@ -226,7 +229,7 @@ gantt_view_chart_scroll_event (GtkWidget * gki, GdkEventScroll * event, PlannerG
}
}
- return TRUE;
+ return dontpropagate;
}
static void
diff --git a/src/planner-usage-view.c b/src/planner-usage-view.c
index 5c17222..c170faa 100644
--- a/src/planner-usage-view.c
+++ b/src/planner-usage-view.c
@@ -124,6 +124,8 @@ G_DEFINE_TYPE (PlannerUsageView, planner_usage_view, PLANNER_TYPE_VIEW);
static gboolean
usage_view_chart_scroll_event (GtkWidget * gki, GdkEventScroll * event, PlannerView *view)
{
+ gboolean dontpropagate = FALSE;
+
gboolean can_in, can_out;
PlannerUsageViewPriv *priv;
@@ -132,11 +134,13 @@ usage_view_chart_scroll_event (GtkWidget * gki, GdkEventScroll * event, PlannerV
planner_usage_chart_can_zoom (priv->chart, &can_in, &can_out);
switch (event->direction) {
case GDK_SCROLL_UP: {
+ dontpropagate = TRUE;
if (can_in)
usage_view_zoom_in_cb (NULL, view);
break;
}
case GDK_SCROLL_DOWN:
+ dontpropagate = TRUE;
if (can_out)
usage_view_zoom_out_cb (NULL, view);
break;
@@ -145,7 +149,7 @@ usage_view_chart_scroll_event (GtkWidget * gki, GdkEventScroll * event, PlannerV
}
}
- return TRUE;
+ return dontpropagate;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]