This commit is contained in:
Piyush मिश्रः 2021-03-18 17:22:22 +05:30
parent cc55babd02
commit fae1d00b86
3 changed files with 12 additions and 3 deletions

View File

@ -30,7 +30,7 @@ fn main() {
}
fn display(app: &Application) {
let builder = gtk::Builder::from_file("ui.glade");
let builder = gtk::Builder::from_file(find_ui_file());
let win = builder.get_object::<gtk::Window>("win").expect("Resource file missing!");
win.set_application(Some(app));
@ -57,3 +57,12 @@ fn display(app: &Application) {
}
});
}
fn find_ui_file() -> String{
let ui_file = std::env::var("RANG_UI_FILE");
match ui_file {
Ok(val) => val,
Err(_) => std::env::current_exe().unwrap().parent().unwrap()
.join("ui.glade").to_str().unwrap().to_owned()
}
}

View File

@ -7,7 +7,7 @@
<property name="type-hint">dialog</property>
<property name="program-name">Rang</property>
<property name="comments" translatable="yes">Color Chooser</property>
<property name="authors">PiyushXCoder (https://gitlab.com/PiyushXCoder)</property>
<property name="authors">https://gitlab.com/PiyushXCoder</property>
<property name="logo-icon-name">gtk-select-color</property>
<property name="license-type">gpl-3-0</property>
<signal name="close" handler="about_close1" swapped="no"/>

View File

@ -7,7 +7,7 @@
<property name="type-hint">dialog</property>
<property name="program-name">Rang</property>
<property name="comments" translatable="yes">Color Chooser</property>
<property name="authors">PiyushXCoder (https://gitlab.com/PiyushXCoder)</property>
<property name="authors">https://gitlab.com/PiyushXCoder</property>
<property name="logo-icon-name">gtk-select-color</property>
<property name="license-type">gpl-3-0</property>
<signal name="close" handler="about_close1" swapped="no"/>