mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
add close actions
This commit is contained in:
parent
ed3b4bcc84
commit
dd1a4e6f3c
@ -39,6 +39,8 @@ impl Window {
|
|||||||
) -> Self {
|
) -> Self {
|
||||||
// Init components
|
// Init components
|
||||||
let tab = Tab::new_arc(
|
let tab = Tab::new_arc(
|
||||||
|
action_page_close.clone(),
|
||||||
|
action_page_close_all.clone(),
|
||||||
action_page_home.clone(),
|
action_page_home.clone(),
|
||||||
action_page_history_back.clone(),
|
action_page_history_back.clone(),
|
||||||
action_page_history_forward.clone(),
|
action_page_history_forward.clone(),
|
||||||
|
@ -34,7 +34,8 @@ pub struct Tab {
|
|||||||
impl Tab {
|
impl Tab {
|
||||||
// Construct
|
// Construct
|
||||||
pub fn new_arc(
|
pub fn new_arc(
|
||||||
// Actions
|
action_page_close: SimpleAction,
|
||||||
|
action_page_close_all: SimpleAction,
|
||||||
action_page_home: SimpleAction,
|
action_page_home: SimpleAction,
|
||||||
action_page_history_back: SimpleAction,
|
action_page_history_back: SimpleAction,
|
||||||
action_page_history_forward: SimpleAction,
|
action_page_history_forward: SimpleAction,
|
||||||
@ -56,6 +57,20 @@ impl Tab {
|
|||||||
Some(&gformat!("win.{}", action_page_reload.name())),
|
Some(&gformat!("win.{}", action_page_reload.name())),
|
||||||
); // @TODO resolve namespace outside
|
); // @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
|
// Init widget
|
||||||
let widget = Arc::new(Widget::new(&menu));
|
let widget = Arc::new(Widget::new(&menu));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user