about summary refs log tree commit diff
path: root/src/ui/window.rs
diff options
context:
space:
mode:
authorRicky Kresslein <rk@lakoliu.com>2022-04-08 13:01:33 +0300
committerRicky Kresslein <rk@lakoliu.com>2022-04-08 13:01:33 +0300
commit707e8ed72d248bcc80a19c9220c1cc6de4dba28d (patch)
tree2d56a1df9162e2f146ca85c5382e453f4c30f660 /src/ui/window.rs
parent8ebe4c9723a8da0eb64a5f78457802705d189049 (diff)
downloadFurtherance-707e8ed72d248bcc80a19c9220c1cc6de4dba28d.tar.zst
Minimum height changes for task list or empty views (Issue #16)
Diffstat (limited to 'src/ui/window.rs')
-rwxr-xr-xsrc/ui/window.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui/window.rs b/src/ui/window.rs
index c955451..a9b43bd 100755
--- a/src/ui/window.rs
+++ b/src/ui/window.rs
@@ -153,6 +153,17 @@ impl FurtheranceWindow {
     fn setup_widgets(&self) {
         let imp = imp::FurtheranceWindow::from_instance(self);
 
+        // Set initial minimum height
+        let is_saved_task: bool = match database::check_for_tasks() {
+            Ok(_) => true,
+            Err(_) => false,
+        };
+        if is_saved_task {
+            self.set_height_request(300);
+        } else {
+            self.set_height_request(390);
+        }
+
         // Development mode
         if config::PROFILE == "development" {
             self.add_css_class("devel");