about_dialog.rs (1245B)
1 use crate::config::{APP_ID, VERSION}; 2 use gtk::prelude::GtkWindowExt; 3 use relm4::*; 4 5 pub struct AboutWindow {} 6 7 impl SimpleComponent for AboutWindow { 8 type Init = (); 9 type Widgets = gtk::AboutDialog; 10 type Input = (); 11 type Output = (); 12 type Root = gtk::AboutDialog; 13 14 fn init_root() -> Self::Root { 15 gtk::AboutDialog::builder() 16 .logo_icon_name(APP_ID) 17 .license_type(gtk::License::Agpl30) 18 .version(VERSION) 19 .modal(true) 20 .authors(vec!["MTRNord"]) 21 .artists(vec!["MTRNord"]) 22 .comments("A Rust GTK4 email client") 23 .website_label("Github repository") 24 .website("https://github.com/erooster-mail/email-client") 25 .copyright("Licensed AGPL-v3.0-or-later license") 26 .program_name("Email Client") 27 .build() 28 } 29 30 fn init( 31 _: Self::Init, 32 root: &Self::Root, 33 _sender: ComponentSender<Self>, 34 ) -> ComponentParts<Self> { 35 let model = Self {}; 36 37 let widgets = root.clone(); 38 39 ComponentParts { model, widgets } 40 } 41 42 fn update_view(&self, dialog: &mut Self::Widgets, _sender: ComponentSender<Self>) { 43 dialog.present(); 44 } 45 }