about.rs (1314B)
1 use gtk::prelude::GtkWindowExt; 2 use relm4::{adw, gtk, ComponentParts, ComponentSender, SimpleComponent}; 3 4 use crate::config::{APP_ID, VERSION}; 5 6 pub struct AboutDialog {} 7 8 impl SimpleComponent for AboutDialog { 9 type Init = (); 10 type Widgets = adw::AboutWindow; 11 type Input = (); 12 type Output = (); 13 type Root = adw::AboutWindow; 14 15 fn init_root() -> Self::Root { 16 adw::AboutWindow::builder() 17 .application_icon(APP_ID) 18 .license_type(gtk::License::Agpl30) 19 .website("https://github.com/MTRNord/heic2jpg") 20 .issue_url("https://github.com/MTRNord/heic2jpg/issues") 21 .application_name("Heic2JPG") 22 .version(VERSION) 23 .translator_credits("translator-credits") 24 .copyright("© 2024 MTRNord") 25 .developers(vec!["MTRNord"]) 26 .designers(vec!["MTRNord"]) 27 .hide_on_close(true) 28 .build() 29 } 30 31 fn init( 32 _: Self::Init, 33 root: Self::Root, 34 _sender: ComponentSender<Self>, 35 ) -> ComponentParts<Self> { 36 let model = Self {}; 37 38 let widgets = root.clone(); 39 40 ComponentParts { model, widgets } 41 } 42 43 fn update_view(&self, dialog: &mut Self::Widgets, _sender: ComponentSender<Self>) { 44 dialog.present(); 45 } 46 }