From 69339f73a8ad166323b1d2e28b7b88707805cb9f Mon Sep 17 00:00:00 2001 From: AshkanArabim Date: Sat, 16 Mar 2024 15:18:53 -0600 Subject: [PATCH] timer: add title input in timer setup I added a simple GtkEntry for users to enter the timer name in the creation interface. Previously, users had to create a timer, pause it, and only then change the timer's name. Fixes https://gitlab.gnome.org/GNOME/gnome-clocks/-/issues/93 Fixes https://gitlab.gnome.org/GNOME/gnome-clocks/-/issues/255 --- data/ui/timer-setup.ui | 10 ++++++++++ src/timer-setup.vala | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/data/ui/timer-setup.ui b/data/ui/timer-setup.ui index d1b446c1..19863397 100644 --- a/data/ui/timer-setup.ui +++ b/data/ui/timer-setup.ui @@ -256,6 +256,16 @@ + + + 302 + + + Title + + + + diff --git a/src/timer-setup.vala b/src/timer-setup.vala index e9b2be91..14ce4d64 100644 --- a/src/timer-setup.vala +++ b/src/timer-setup.vala @@ -30,7 +30,8 @@ public class Setup : Gtk.Box { private unowned Gtk.SpinButton m_spinbutton; [GtkChild] private unowned Gtk.SpinButton s_spinbutton; - + [GtkChild] + private unowned Gtk.Entry title_entry; [GtkChild] private unowned Gtk.Grid time_grid; @@ -67,7 +68,7 @@ public class Setup : Gtk.Box { } public Item get_timer () { - return (new Item.from_seconds (get_duration (), "")); + return (new Item.from_seconds (get_duration (), title_entry.text)); } // This callback is called on `changed` (from `Gtk.Editable`) rather than on -- GitLab