Changes
4 changed files (+42/-9)
-
-
@@ -10,6 +10,8 @@ using GLib;namespace TimeTracker.Widget { private class ActiveTimersView : Gtk.Box { public signal void edit_timer(Model.Timer timer); public Model.Model model { get; construct; } private NewTimerForm form = new NewTimerForm();
-
@@ -40,6 +42,9 @@ namespace TimeTracker.Widget {list.stop.connect((timer) => { model.update(new Event.TimerStopped(timer.id)); }); list.edit.connect((timer) => { edit_timer(timer); }); body.child = list; form.create.connect((title) => {
-
-
-
@@ -24,8 +24,15 @@ namespace TimeTracker.Widget {var stack = new Adw.ViewStack(); var active_timers = new ActiveTimersView(model); active_timers.edit_timer.connect((timer) => { var dialog = new TimerEditDialog(model, timer); dialog.present(this); }); stack.add_titled_with_icon( new ActiveTimersView(model), active_timers, "active_timers", "Timers", "appointment-new-symbolic"
-
-
-
@@ -11,6 +11,7 @@ using GLib;namespace TimeTracker.Widget { private class TimerList : Gtk.Box { public signal void stop(Model.Timer timer); public signal void edit(Model.Timer timer); public ListModel timers { get; construct; }
-
@@ -42,6 +43,9 @@ namespace TimeTracker.Widget {row.stop.connect((timer) => { stop(timer); }); row.edit.connect((timer) => { edit(timer); }); list_item.child = row; }
-
-
-
@@ -15,6 +15,11 @@ namespace TimeTracker.Widget {*/ public signal void stop(Model.Timer timer); /** * User requested to edit the timer. */ public signal void edit(Model.Timer timer); public Model.Timer? timer { get; set construct; } private Binding? timer_binding = null;
-
@@ -31,9 +36,9 @@ namespace TimeTracker.Widget {compact = true, }; private Gtk.Button stop_button = new Gtk.Button() { private Adw.SplitButton actions = new Adw.SplitButton() { valign = START, label = "Stop", visible = false, }; construct {
-
@@ -44,8 +49,6 @@ namespace TimeTracker.Widget {} if (timer != null) { stop_button.visible = true; timer_binding = timer.bind_property("title", title, "label", SYNC_CREATE); update_elapsed();
-
@@ -56,8 +59,6 @@ namespace TimeTracker.Widget {return !timer.is_stopped; }); } else { stop_button.visible = false; } } });
-
@@ -78,13 +79,29 @@ namespace TimeTracker.Widget {this.append(info_col); stop_button.clicked.connect(() => { var action_group = new SimpleActionGroup(); var edit_action = new SimpleAction("Edit", null); edit_action.activate.connect(() => { if (timer != null) { this.edit(timer); } }); action_group.add_action(edit_action); this.insert_action_group("ActiveTimerActions", action_group); var menu = new Menu(); menu.append("Edit", "ActiveTimerActions.Edit"); actions.menu_model = menu; actions.clicked.connect(() => { if (timer != null) { this.stop(timer); } }); this.append(stop_button); this.append(actions); } private void update_elapsed() {
-