mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
add close actions
This commit is contained in:
parent
ed3b4bcc84
commit
dd1a4e6f3c
2 changed files with 18 additions and 1 deletions
|
|
@ -39,6 +39,8 @@ impl Window {
|
|||
) -> Self {
|
||||
// Init components
|
||||
let tab = Tab::new_arc(
|
||||
action_page_close.clone(),
|
||||
action_page_close_all.clone(),
|
||||
action_page_home.clone(),
|
||||
action_page_history_back.clone(),
|
||||
action_page_history_forward.clone(),
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ pub struct Tab {
|
|||
impl Tab {
|
||||
// Construct
|
||||
pub fn new_arc(
|
||||
// Actions
|
||||
action_page_close: SimpleAction,
|
||||
action_page_close_all: SimpleAction,
|
||||
action_page_home: SimpleAction,
|
||||
action_page_history_back: SimpleAction,
|
||||
action_page_history_forward: SimpleAction,
|
||||
|
|
@ -56,6 +57,20 @@ impl Tab {
|
|||
Some(&gformat!("win.{}", action_page_reload.name())),
|
||||
); // @TODO resolve namespace outside
|
||||
|
||||
let close = Menu::new();
|
||||
|
||||
close.append(
|
||||
Some("Current"),
|
||||
Some(&gformat!("win.{}", action_page_close.name())),
|
||||
);
|
||||
|
||||
close.append(
|
||||
Some("All"),
|
||||
Some(&gformat!("win.{}", action_page_close_all.name())),
|
||||
);
|
||||
|
||||
menu.append_submenu(Some("Close"), &close);
|
||||
|
||||
// Init widget
|
||||
let widget = Arc::new(Widget::new(&menu));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue