fixes
This commit is contained in:
parent
cc55babd02
commit
fae1d00b86
11
src/main.rs
11
src/main.rs
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
ui.glade
2
ui.glade
|
|
@ -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"/>
|
||||
|
|
|
|||
|
|
@ -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"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue