feat: implement win.close action
parent
67a1f0057e
commit
d38ad0627c
|
@ -9,8 +9,8 @@ pub trait MenubarImplementedEditor {
|
||||||
fn setup_menubar(
|
fn setup_menubar(
|
||||||
&self,
|
&self,
|
||||||
app: &super::EchidnaEditor,
|
app: &super::EchidnaEditor,
|
||||||
window: gtk::ApplicationWindow,
|
window: >k::ApplicationWindow,
|
||||||
builder: gtk::Builder,
|
builder: >k::Builder,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ impl MenubarImplementedEditor for EchidnaEditor {
|
||||||
fn setup_menubar(
|
fn setup_menubar(
|
||||||
&self,
|
&self,
|
||||||
app: &super::EchidnaEditor,
|
app: &super::EchidnaEditor,
|
||||||
window: gtk::ApplicationWindow,
|
window: >k::ApplicationWindow,
|
||||||
builder: gtk::Builder,
|
builder: >k::Builder,
|
||||||
) {
|
) {
|
||||||
let menubuilder = gtk::Builder::from_string(include_str!("../../ui/menu.ui"));
|
let menubuilder = gtk::Builder::from_string(include_str!("../../ui/menu.ui"));
|
||||||
let menubar: MenuModel = menubuilder
|
let menubar: MenuModel = menubuilder
|
||||||
|
@ -75,6 +75,17 @@ impl MenubarImplementedEditor for EchidnaEditor {
|
||||||
about_dialog.set_visible(true);
|
about_dialog.set_visible(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let act_window_close = SimpleAction::new("close", None);
|
||||||
|
|
||||||
|
window.add_action(&act_window_close);
|
||||||
|
|
||||||
|
act_window_close.connect_activate(clone!(@weak window =>
|
||||||
|
move | _action, _variant | {
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
let action_open_file: SimpleAction = SimpleAction::new("open-file", None);
|
let action_open_file: SimpleAction = SimpleAction::new("open-file", None);
|
||||||
|
|
||||||
window.add_action(&action_open_file);
|
window.add_action(&action_open_file);
|
||||||
|
|
Loading…
Reference in New Issue