From 239add0b868bb338a0eb9998fa2e5d9b23550a99 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Mon, 14 Dec 2020 18:34:46 +0100 Subject: [PATCH 14/16] timer: Allow much smaller heights useing a ScrolledWindow --- data/ui/timer-face.ui | 81 +++++++++++++++++++++---------------- data/ui/timer-setup.ui | 1 - src/timer-setup-dialog.vala | 13 +++++- 3 files changed, 57 insertions(+), 38 deletions(-) diff --git a/data/ui/timer-face.ui b/data/ui/timer-face.ui index 123a8c5..87331ec 100644 --- a/data/ui/timer-face.ui +++ b/data/ui/timer-face.ui @@ -7,55 +7,66 @@ True False - + True - False - center - center - vertical - 18 + True + True + never + True + True - + True False - Select Duration - - - - False - True - 0 - - - - - True - True - True center center + vertical + 18 + 12 - + True False + Select Duration + + + + False + True + 0 + + + + + True + True + True center center - media-playback-start-symbolic + + + True + False + center + center + media-playback-start-symbolic + + + + + False + True + 1 + - - - False - True - 1 - diff --git a/data/ui/timer-setup.ui b/data/ui/timer-setup.ui index 588aedb..37a181d 100644 --- a/data/ui/timer-setup.ui +++ b/data/ui/timer-setup.ui @@ -198,7 +198,6 @@ True False 12 - 12 True diff --git a/src/timer-setup-dialog.vala b/src/timer-setup-dialog.vala index e360ad8..6e94b90 100644 --- a/src/timer-setup-dialog.vala +++ b/src/timer-setup-dialog.vala @@ -25,14 +25,23 @@ public class SetupDialog: Gtk.Dialog { public SetupDialog (Gtk.Window parent) { Object (modal: true, transient_for: parent, title: _("New Timer"), use_header_bar: 1); - this.set_default_size (640, 360); add_button (_("Cancel"), Gtk.ResponseType.CANCEL); var create_button = add_button (_("Add"), Gtk.ResponseType.ACCEPT); create_button.get_style_context ().add_class ("suggested-action"); timer_setup = new Setup (); - this.get_content_area ().add (timer_setup); + timer_setup.margin = 12; + var container = new Gtk.ScrolledWindow (null, null); + container.hexpand = true; + container.vexpand = true; + container.propagate_natural_height = true; + container.propagate_natural_width = true; + container.hscrollbar_policy = Gtk.PolicyType.NEVER; + container.border_width = 0; + container.visible = true; + container.add (timer_setup); + this.get_content_area ().add (container); timer_setup.duration_changed.connect ((duration) => { this.set_response_sensitive (Gtk.ResponseType.ACCEPT, duration != 0); }); -- 2.34.1