private void RebuildTooltipTaskGroupModels() { if (backend == null || backend.Tasks == null) { overdue_tasks = null; today_tasks = null; tomorrow_tasks = null; return; } overdue_tasks = TaskGroupModelFactory.CreateOverdueModel(backend.Tasks); today_tasks = TaskGroupModelFactory.CreateTodayModel(backend.Tasks); tomorrow_tasks = TaskGroupModelFactory.CreateTomorrowModel(backend.Tasks); foreach (TaskGroupModel model in new TaskGroupModel[] { overdue_tasks, today_tasks, tomorrow_tasks }) { if (model == null) { continue; } model.RowInserted += OnTooltipModelChanged; model.RowChanged += OnTooltipModelChanged; model.RowDeleted += OnTooltipModelChanged; } }
protected virtual TreeModel CreateModel(DateTime rangeStart, DateTime rangeEnd, ICollection <ITask> tasks) { Model = new TaskGroupModel(rangeStart, rangeEnd, tasks, Application.Preferences); return(new TreeModelListAdapter <ITask> (Model)); }
public TaskGroup(string groupName, DateTime rangeStart, DateTime rangeEnd, Gtk.TreeModel tasks) { hideWhenEmpty = true; // TODO: Add a date time event watcher so that when we rollover to // a new day, we can update the rangeStart and rangeEnd times. The // ranges will be used to determine whether tasks fit into certain // groups in the main TaskWindow. Reference Tomboy's NoteOfTheDay // add-in for code that reacts on day changes. filteredTasks = CreateModel(rangeStart, rangeEnd, tasks); filteredTasks.ShowCompletedTasks = Application.Preferences.GetBool( Preferences.ShowCompletedTasksKey); Application.Preferences.SettingChanged += OnSettingChanged; // TODO: Add something to watch events so that the group will // automatically refilter and display/hide itself accordingly. // // Build the UI // // // Group Header // // Gtk.EventBox eb = new Gtk.EventBox(); // eb.Show(); // eb.BorderWidth = 0; // eb.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(211,215,199)); // eb.ModifyBase(Gtk.StateType.Normal, new Gdk.Color(211,215,199)); Gtk.HBox headerHBox = new Gtk.HBox(false, 0); header = new Gtk.Label(); header.UseMarkup = true; header.UseUnderline = false; header.Markup = GetHeaderMarkup(groupName); header.Xalign = 0; header.Show(); // eb.Add(header); // PackStart (eb, false, false, 0); headerHBox.PackStart(header, false, false, 0); // spacer Gtk.Label spacerLabel = new Gtk.Label(string.Empty); spacerLabel.Show(); headerHBox.PackStart(spacerLabel, true, true, 0); extraWidgetHBox = new Gtk.HBox(false, 0); extraWidgetHBox.Show(); headerHBox.PackStart(extraWidgetHBox, false, false, 0); headerHBox.Show(); PackStart(headerHBox, false, false, 5); // // Group TreeView // treeView = new TaskTreeView(filteredTasks); treeView.Show(); PackStart(treeView, true, true, 0); treeView.NumberOfTasksChanged += OnNumberOfTasksChanged; treeView.RowActivated += OnRowActivated; treeView.ButtonPressEvent += OnButtonPressed; }
private void RebuildTooltipTaskGroupModels() { if (backend == null || backend.Tasks == null) { overdue_tasks = null; today_tasks = null; tomorrow_tasks = null; return; } overdue_tasks = TaskGroupModelFactory.CreateOverdueModel (backend.Tasks); today_tasks = TaskGroupModelFactory.CreateTodayModel (backend.Tasks); tomorrow_tasks = TaskGroupModelFactory.CreateTomorrowModel (backend.Tasks); foreach (TaskGroupModel model in new TaskGroupModel[] { overdue_tasks, today_tasks, tomorrow_tasks }) { if (model == null) { continue; } model.RowInserted += OnTooltipModelChanged; model.RowChanged += OnTooltipModelChanged; model.RowDeleted += OnTooltipModelChanged; } }
public TaskGroup(string groupName, DateTime rangeStart, DateTime rangeEnd, IEnumerable<Task> tasks) { hideWhenEmpty = true; // TODO: Add a date time event watcher so that when we rollover to // a new day, we can update the rangeStart and rangeEnd times. The // ranges will be used to determine whether tasks fit into certain // groups in the main TaskWindow. Reference Tomboy's NoteOfTheDay // add-in for code that reacts on day changes. filteredTasks = CreateModel (rangeStart, rangeEnd, tasks); filteredTasks.ShowCompletedTasks = GtkApplication.Instance.Preferences.GetBool ( Preferences.ShowCompletedTasksKey); GtkApplication.Instance.Preferences.SettingChanged += OnSettingChanged; // TODO: Add something to watch events so that the group will // automatically refilter and display/hide itself accordingly. // // Build the UI // // // Group Header // // Gtk.EventBox eb = new Gtk.EventBox(); // eb.Show(); // eb.BorderWidth = 0; // eb.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(211,215,199)); // eb.ModifyBase(Gtk.StateType.Normal, new Gdk.Color(211,215,199)); Gtk.HBox headerHBox = new Gtk.HBox (false, 0); header = new Gtk.Label (); header.UseMarkup = true; header.UseUnderline = false; header.Markup = GetHeaderMarkup (groupName); header.Xalign = 0; header.Show (); // eb.Add(header); // PackStart (eb, false, false, 0); headerHBox.PackStart (header, false, false, 0); // spacer Gtk.Label spacerLabel = new Gtk.Label (string.Empty); spacerLabel.Show (); headerHBox.PackStart (spacerLabel, true, true, 0); extraWidgetHBox = new Gtk.HBox (false, 0); extraWidgetHBox.Show (); headerHBox.PackStart (extraWidgetHBox, false, false, 0); headerHBox.Show (); PackStart (headerHBox, false, false, 5); // // Group TreeView // treeView = new TaskTreeView (filteredTasks); treeView.Show (); PackStart (treeView, true, true, 0); treeView.NumberOfTasksChanged += OnNumberOfTasksChanged; treeView.RowActivated += OnRowActivated; treeView.ButtonPressEvent += OnButtonPressed; }
private void RebuildTooltipTaskGroupModels() { if (backend == null || backend.Tasks == null) { OverdueTasks = null; TodayTasks = null; TomorrowTasks = null; return; } OverdueTasks = TaskGroupModelFactory.CreateOverdueModel (backend.Tasks); TodayTasks = TaskGroupModelFactory.CreateTodayModel (backend.Tasks); TomorrowTasks = TaskGroupModelFactory.CreateTomorrowModel (backend.Tasks); foreach (TaskGroupModel model in new TaskGroupModel[] { OverdueTasks, TodayTasks, TomorrowTasks }) { if (model == null) { continue; } model.CollectionChanged += OnTooltipModelChanged; } }
protected virtual TreeModel CreateModel(DateTime rangeStart, DateTime rangeEnd, ICollection<ITask> tasks) { Model = new TaskGroupModel (rangeStart, rangeEnd, tasks, Application.Preferences); return new TreeModelListAdapter<ITask> (Model); }