From 0fad55124684989ec9fd9a742b5731359d0238ce Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 17 Nov 2024 11:07:01 +0100 Subject: Upgrade dependencies --- src/gui/app.rs | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'src/gui/app.rs') diff --git a/src/gui/app.rs b/src/gui/app.rs index aa8359a..ab3f9c0 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -3,8 +3,6 @@ use gtk4 as gtk; use anyhow::Result; use async_channel::Sender; use chrono::{Datelike, Duration, NaiveDate, Weekday}; -use gtk::glib::signal::Inhibit; -use gtk::prelude::*; use rusqlite::Connection; use std::rc::Rc; @@ -31,16 +29,6 @@ pub struct App { impl App { pub fn new(conn: Rc, app: >k::Application, tx: Sender) -> Result { - let window = Rc::new( - gtk::ApplicationWindow::builder() - .application(app) - .title("Calendrier") - .default_width(800) - .default_height(600) - .visible(true) - .build(), - ); - let today = chrono::offset::Local::now().naive_local().date(); // TODO: error handling let start_date = @@ -73,14 +61,16 @@ impl App { // notebook.append_page(&categories, Some(>k::Label::new(Some("Catégories")))); // window.set_child(Some(¬ebook)); - window.set_child(Some(&calendar)); - - window.connect_close_request(move |window| { - if let Some(application) = window.application() { - application.remove_window(window); - } - Inhibit(false) - }); + let window = Rc::new( + gtk::ApplicationWindow::builder() + .application(app) + .title("Calendrier") + .default_width(800) + .default_height(600) + .visible(true) + .child(&calendar) + .build(), + ); Ok(Self { conn, -- cgit v1.2.3