mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
create separated wrapper for pin action
This commit is contained in:
parent
e47c22ac92
commit
33b22ca30a
11 changed files with 152 additions and 54 deletions
|
|
@ -1,3 +1,6 @@
|
|||
use std::rc::Rc;
|
||||
|
||||
use crate::app::browser::window::action::Action as WindowAction;
|
||||
use gtk::{gio::SimpleAction, prelude::ActionExt};
|
||||
|
||||
/// Context menu wrapper
|
||||
|
|
@ -12,12 +15,12 @@ impl Menu {
|
|||
|
||||
/// Create new `Self`
|
||||
pub fn new(
|
||||
window_action: Rc<WindowAction>,
|
||||
action_page_close_all: SimpleAction,
|
||||
action_page_close: SimpleAction,
|
||||
action_page_history_back: SimpleAction,
|
||||
action_page_history_forward: SimpleAction,
|
||||
action_page_home: SimpleAction,
|
||||
action_page_pin: SimpleAction,
|
||||
action_page_reload: SimpleAction,
|
||||
) -> Self {
|
||||
let main = gtk::gio::Menu::new();
|
||||
|
|
@ -27,7 +30,14 @@ impl Menu {
|
|||
Some(&detailed_action_name(action_page_reload)),
|
||||
);
|
||||
|
||||
main.append(Some("Pin"), Some(&detailed_action_name(action_page_pin)));
|
||||
main.append(
|
||||
Some("Pin"),
|
||||
Some(&format!(
|
||||
"{}.{}",
|
||||
window_action.id(),
|
||||
window_action.pin().id()
|
||||
)),
|
||||
);
|
||||
|
||||
let navigation = gtk::gio::Menu::new();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue