mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
begin window actions group implementation
This commit is contained in:
parent
5f280efaf3
commit
36b86ef5cf
15 changed files with 145 additions and 63 deletions
|
|
@ -30,7 +30,6 @@ impl Browser {
|
|||
// Construct
|
||||
pub fn new(
|
||||
profile: Rc<Profile>,
|
||||
action_page_new: SimpleAction,
|
||||
action_page_close: SimpleAction,
|
||||
action_page_close_all: SimpleAction,
|
||||
action_page_home: SimpleAction,
|
||||
|
|
@ -43,7 +42,6 @@ impl Browser {
|
|||
let action = Rc::new(Action::new());
|
||||
let window = Rc::new(Window::new(
|
||||
action.clone(),
|
||||
action_page_new.clone(),
|
||||
action_page_close.clone(),
|
||||
action_page_close_all.clone(),
|
||||
action_page_home.clone(),
|
||||
|
|
@ -57,7 +55,6 @@ impl Browser {
|
|||
let widget = Rc::new(Widget::new(
|
||||
window.gobject(),
|
||||
&[
|
||||
action_page_new.clone(),
|
||||
action_page_close.clone(),
|
||||
action_page_close_all.clone(),
|
||||
action_page_home.clone(),
|
||||
|
|
@ -68,11 +65,17 @@ impl Browser {
|
|||
],
|
||||
));
|
||||
|
||||
// Connect actions to browser window
|
||||
// Connect browser actions to window
|
||||
widget
|
||||
.gobject()
|
||||
.insert_action_group(action.id(), Some(action.gobject()));
|
||||
|
||||
// Connect tab actions to window
|
||||
widget.gobject().insert_action_group(
|
||||
window.tab().action().id(),
|
||||
Some(window.tab().action().gobject()),
|
||||
); // @TODO is really wanted to append it here?
|
||||
|
||||
// Connect events
|
||||
action.about().connect_activate({
|
||||
let window = window.clone();
|
||||
|
|
@ -113,13 +116,6 @@ impl Browser {
|
|||
});
|
||||
|
||||
// @TODO
|
||||
action_page_new.connect_activate({
|
||||
let window = window.clone();
|
||||
move |_, _| {
|
||||
window.tab_append(None);
|
||||
}
|
||||
});
|
||||
|
||||
action_page_close.connect_activate({
|
||||
let window = window.clone();
|
||||
move |this, _| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue