[california/wip/730602-stack] Fix tooltips for events that span days
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [california/wip/730602-stack] Fix tooltips for events that span days
- Date: Wed, 22 Oct 2014 01:32:46 +0000 (UTC)
commit 80ba2839d6b2267502519d138798533e6577be5e
Author: Jim Nelson <jim yorba org>
Date: Tue Oct 21 18:32:24 2014 -0700
Fix tooltips for events that span days
src/view/week/week-day-pane.vala | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/view/week/week-day-pane.vala b/src/view/week/week-day-pane.vala
index b5b6624..d728d72 100644
--- a/src/view/week/week-day-pane.vala
+++ b/src/view/week/week-day-pane.vala
@@ -88,6 +88,7 @@ internal class DayPane : Pane, Common.InstanceContainer {
private Gee.TreeSet<EventStack> event_stacks = new Gee.TreeSet<EventStack>();
private Toolkit.RegionManager<Component.Event> region_manager = new
Toolkit.RegionManager<Component.Event>();
private Scheduled? scheduled_monitor = null;
+ private string key_tooltip_date;
public DayPane(Grid owner, Calendar.Date date) {
base (owner, -1);
@@ -97,6 +98,10 @@ internal class DayPane : Pane, Common.InstanceContainer {
// see query_tooltip()
has_tooltip = true;
+ // store individual tooltip keys so tooltips can be maintained across days for the same
+ // event
+ key_tooltip_date = KEY_TOOLTIP + date.to_string();;
+
notify[PROP_DATE].connect(queue_draw);
Calendar.System.instance.is_24hr_changed.connect(queue_draw);
@@ -294,7 +299,7 @@ internal class DayPane : Pane, Common.InstanceContainer {
if (found == null)
return false;
- string? tooltip_text = found.get_data<string?>(KEY_TOOLTIP);
+ string? tooltip_text = found.get_data<string?>(key_tooltip_date);
if (String.is_empty(tooltip_text))
return false;
@@ -379,7 +384,7 @@ internal class DayPane : Pane, Common.InstanceContainer {
// if either was ellipsized, set tooltip (otherwise clear any existing)
bool is_ellipsized = layout_0.is_ellipsized() || layout_1.is_ellipsized();
- event.set_data<string?>(KEY_TOOLTIP,
+ event.set_data<string?>(key_tooltip_date,
is_ellipsized ? "%s\n%s".printf(timespan, GLib.Markup.escape_text(event.summary)) :
null);
ctr++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]