[california/wip/731635-hotspot] Week view
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [california/wip/731635-hotspot] Week view
- Date: Fri, 19 Sep 2014 23:05:27 +0000 (UTC)
commit 07c2cd0138f303a19be3672d86985cefb37dbdad
Author: Jim Nelson <jim yorba org>
Date: Fri Sep 19 16:05:22 2014 -0700
Week view
src/view/month/month-grid.vala | 5 ++---
src/view/week/week-grid.vala | 24 ++++++++++++++++++++----
2 files changed, 22 insertions(+), 7 deletions(-)
---
diff --git a/src/view/month/month-grid.vala b/src/view/month/month-grid.vala
index d7afbe7..6b48b1e 100644
--- a/src/view/month/month-grid.vala
+++ b/src/view/month/month-grid.vala
@@ -359,10 +359,9 @@ private class Grid : Gtk.Grid {
private void on_cell_motion(Toolkit.MotionEvent details) {
Cell cell = (Cell) details.widget;
- Component.Event? event = cell.get_event_at(details.point);
-
+ // if hovering over an event, show the "hyperlink" cursor
Gdk.CursorType? cursor_type = null;
- if (event != null)
+ if (cell.get_event_at(details.point) != null)
cursor_type = Gdk.CursorType.HAND1;
Toolkit.set_toplevel_cursor(cell, cursor_type);
diff --git a/src/view/week/week-grid.vala b/src/view/week/week-grid.vala
index e79af4e..f49adb3 100644
--- a/src/view/week/week-grid.vala
+++ b/src/view/week/week-grid.vala
@@ -49,8 +49,8 @@ internal class Grid : Gtk.Box {
private Toolkit.ButtonConnector instance_container_button_connector = new Toolkit.ButtonConnector();
private Toolkit.ButtonConnector all_day_button_connector = new Toolkit.ButtonConnector();
private Toolkit.ButtonConnector day_pane_button_connector = new Toolkit.ButtonConnector();
- private Toolkit.MotionConnector day_pane_motion_connector = new Toolkit.MotionConnector.button_only();
- private Toolkit.MotionConnector all_day_cell_motion_connector = new
Toolkit.MotionConnector.button_only();
+ private Toolkit.MotionConnector day_pane_motion_connector = new Toolkit.MotionConnector();
+ private Toolkit.MotionConnector all_day_cell_motion_connector = new Toolkit.MotionConnector();
private Gtk.ScrolledWindow scrolled_panes;
private Gtk.Widget right_spacer;
private bool vadj_init = false;
@@ -150,8 +150,10 @@ internal class Grid : Gtk.Box {
instance_container_button_connector.double_clicked.connect(on_instance_container_double_clicked);
// connect to individual motion event handlers for different types of instance containers
+ all_day_cell_motion_connector.motion.connect(on_instance_container_motion);
all_day_cell_motion_connector.button_motion.connect(on_all_day_cell_button_motion);
- day_pane_motion_connector.button_motion.connect(on_day_pane_motion);
+ day_pane_motion_connector.motion.connect(on_instance_container_motion);
+ day_pane_motion_connector.button_motion.connect(on_day_pane_button_motion);
// connect to individual button released handlers for different types of instance containers
all_day_button_connector.released.connect(on_all_day_cell_button_released);
@@ -336,6 +338,8 @@ internal class Grid : Gtk.Box {
if (details.button != Toolkit.Button.PRIMARY)
return Toolkit.PROPAGATE;
+ Toolkit.set_toplevel_cursor(this, null);
+
Common.InstanceContainer instance_container = (Common.InstanceContainer) details.widget;
Component.Event? event = instance_container.get_event_at(details.press_point);
@@ -345,6 +349,16 @@ internal class Grid : Gtk.Box {
return Toolkit.STOP;
}
+ private void on_instance_container_motion(Toolkit.MotionEvent details) {
+ Common.InstanceContainer instance_container = (Common.InstanceContainer) details.widget;
+
+ Gdk.CursorType? cursor_type = null;
+ if (instance_container.get_event_at(details.point) != null)
+ cursor_type = Gdk.CursorType.HAND1;
+
+ Toolkit.set_toplevel_cursor(instance_container, cursor_type);
+ }
+
private bool on_instance_container_double_clicked(Toolkit.ButtonEvent details) {
if (details.button != Toolkit.Button.PRIMARY)
return Toolkit.PROPAGATE;
@@ -355,6 +369,8 @@ internal class Grid : Gtk.Box {
if (instance_container.get_event_at(details.press_point) != null)
return Toolkit.PROPAGATE;
+ Toolkit.set_toplevel_cursor(instance_container, null);
+
// if a DayPane, use double-click to determine rounded time of the event's start
DayPane? day_pane = instance_container as DayPane;
if (day_pane != null) {
@@ -379,7 +395,7 @@ internal class Grid : Gtk.Box {
return Toolkit.STOP;
}
- private void on_day_pane_motion(Toolkit.MotionEvent details) {
+ private void on_day_pane_button_motion(Toolkit.MotionEvent details) {
DayPane day_pane = (DayPane) details.widget;
// only update selection as long as button is depressed
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]