mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
rename actions
This commit is contained in:
parent
2d08e8386d
commit
313122e5c3
26 changed files with 274 additions and 290 deletions
|
|
@ -19,34 +19,34 @@ pub struct Bar {
|
|||
impl Bar {
|
||||
// Construct
|
||||
pub fn new_arc(
|
||||
action_tool_debug: SimpleAction,
|
||||
action_tool_profile: SimpleAction,
|
||||
action_debug: SimpleAction,
|
||||
action_profile: SimpleAction,
|
||||
action_quit: SimpleAction,
|
||||
action_tab_append: SimpleAction,
|
||||
action_tab_close: SimpleAction,
|
||||
action_tab_close_all: SimpleAction,
|
||||
action_tab_page_navigation_base: SimpleAction,
|
||||
action_tab_page_navigation_history_back: SimpleAction,
|
||||
action_tab_page_navigation_history_forward: SimpleAction,
|
||||
action_tab_page_navigation_reload: SimpleAction,
|
||||
action_tab_pin: SimpleAction,
|
||||
action_page_new: SimpleAction,
|
||||
action_page_close: SimpleAction,
|
||||
action_page_close_all: SimpleAction,
|
||||
action_page_base: SimpleAction,
|
||||
action_page_history_back: SimpleAction,
|
||||
action_page_history_forward: SimpleAction,
|
||||
action_page_reload: SimpleAction,
|
||||
action_page_pin: SimpleAction,
|
||||
view: &TabView,
|
||||
) -> Arc<Self> {
|
||||
// Init components
|
||||
let control = Control::new_arc();
|
||||
let tab = Tab::new_arc(action_tab_append.clone(), view);
|
||||
let tab = Tab::new_arc(action_page_new.clone(), view);
|
||||
let menu = Menu::new_arc(
|
||||
action_tool_debug,
|
||||
action_tool_profile,
|
||||
action_debug,
|
||||
action_profile,
|
||||
action_quit,
|
||||
action_tab_append,
|
||||
action_tab_close,
|
||||
action_tab_close_all,
|
||||
action_tab_page_navigation_base,
|
||||
action_tab_page_navigation_history_back,
|
||||
action_tab_page_navigation_history_forward,
|
||||
action_tab_page_navigation_reload,
|
||||
action_tab_pin,
|
||||
action_page_new,
|
||||
action_page_close,
|
||||
action_page_close_all,
|
||||
action_page_base,
|
||||
action_page_history_back,
|
||||
action_page_history_forward,
|
||||
action_page_reload,
|
||||
action_page_pin,
|
||||
);
|
||||
|
||||
// Build result
|
||||
|
|
|
|||
|
|
@ -17,35 +17,35 @@ pub struct Menu {
|
|||
#[rustfmt::skip] // @TODO template builder?
|
||||
impl Menu {
|
||||
pub fn new_arc(
|
||||
action_tool_debug: SimpleAction,
|
||||
action_tool_profile: SimpleAction,
|
||||
action_debug: SimpleAction,
|
||||
action_profile: SimpleAction,
|
||||
action_quit: SimpleAction,
|
||||
action_tab_append: SimpleAction,
|
||||
action_tab_close: SimpleAction,
|
||||
action_tab_close_all: SimpleAction,
|
||||
action_tab_page_navigation_base: SimpleAction,
|
||||
action_tab_page_navigation_history_back: SimpleAction,
|
||||
action_tab_page_navigation_history_forward: SimpleAction,
|
||||
action_tab_page_navigation_reload: SimpleAction,
|
||||
action_tab_pin: SimpleAction,
|
||||
action_page_new: SimpleAction,
|
||||
action_page_close: SimpleAction,
|
||||
action_page_close_all: SimpleAction,
|
||||
action_page_base: SimpleAction,
|
||||
action_page_history_back: SimpleAction,
|
||||
action_page_history_forward: SimpleAction,
|
||||
action_page_reload: SimpleAction,
|
||||
action_page_pin: SimpleAction,
|
||||
) -> Arc<Self> {
|
||||
// Main
|
||||
let main = gio::Menu::new();
|
||||
|
||||
// Main > Page
|
||||
let main_page = gio::Menu::new();
|
||||
main_page.append(Some("New"), Some(&detailed_action_name(action_tab_append)));
|
||||
main_page.append(Some("Reload"), Some(&detailed_action_name(action_tab_page_navigation_reload)));
|
||||
main_page.append(Some("Pin"), Some(&detailed_action_name(action_tab_pin)));
|
||||
main_page.append(Some("New"), Some(&detailed_action_name(action_page_new)));
|
||||
main_page.append(Some("Reload"), Some(&detailed_action_name(action_page_reload)));
|
||||
main_page.append(Some("Pin"), Some(&detailed_action_name(action_page_pin)));
|
||||
|
||||
// Main > Page > Navigation
|
||||
let main_page_navigation = gio::Menu::new();
|
||||
main_page_navigation.append(Some("Base"), Some(&detailed_action_name(action_tab_page_navigation_base)));
|
||||
main_page_navigation.append(Some("Base"), Some(&detailed_action_name(action_page_base)));
|
||||
|
||||
// Main > Page > Navigation > History
|
||||
let main_page_navigation_history = gio::Menu::new();
|
||||
main_page_navigation_history.append(Some("Back"), Some(&detailed_action_name(action_tab_page_navigation_history_back)));
|
||||
main_page_navigation_history.append(Some("Forward"), Some(&detailed_action_name(action_tab_page_navigation_history_forward)));
|
||||
main_page_navigation_history.append(Some("Back"), Some(&detailed_action_name(action_page_history_back)));
|
||||
main_page_navigation_history.append(Some("Forward"), Some(&detailed_action_name(action_page_history_forward)));
|
||||
|
||||
main_page_navigation.append_submenu(Some("History"), &main_page_navigation_history);
|
||||
|
||||
|
|
@ -53,8 +53,8 @@ impl Menu {
|
|||
|
||||
// Main > Page > Close
|
||||
let main_page_close = gio::Menu::new();
|
||||
main_page_close.append(Some("Current"), Some(&detailed_action_name(action_tab_close)));
|
||||
main_page_close.append(Some("All"), Some(&detailed_action_name(action_tab_close_all)));
|
||||
main_page_close.append(Some("Current"), Some(&detailed_action_name(action_page_close)));
|
||||
main_page_close.append(Some("All"), Some(&detailed_action_name(action_page_close_all)));
|
||||
|
||||
main_page.append_submenu(Some("Close"), &main_page_close);
|
||||
|
||||
|
|
@ -62,8 +62,8 @@ impl Menu {
|
|||
|
||||
// Main > Tool
|
||||
let main_tool = gio::Menu::new();
|
||||
main_tool.append(Some("Debug"), Some(&detailed_action_name(action_tool_debug)));
|
||||
main_tool.append(Some("Profile"), Some(&detailed_action_name(action_tool_profile)));
|
||||
main_tool.append(Some("Debug"), Some(&detailed_action_name(action_debug)));
|
||||
main_tool.append(Some("Profile"), Some(&detailed_action_name(action_profile)));
|
||||
|
||||
main.append_submenu(Some("Tool"), &main_tool);
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ pub struct Tab {
|
|||
|
||||
impl Tab {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_append: SimpleAction, view: &TabView) -> Arc<Self> {
|
||||
pub fn new_arc(action_page_new: SimpleAction, view: &TabView) -> Arc<Self> {
|
||||
Arc::new(Self {
|
||||
widget: Widget::new_arc(view, Append::new_arc(action_tab_append).gobject()),
|
||||
widget: Widget::new_arc(view, Append::new_arc(action_page_new).gobject()),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ pub struct Append {
|
|||
|
||||
impl Append {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_append: SimpleAction) -> Arc<Self> {
|
||||
pub fn new_arc(action_page_new: SimpleAction) -> Arc<Self> {
|
||||
Arc::new(Self {
|
||||
widget: Widget::new_arc(action_tab_append),
|
||||
widget: Widget::new_arc(action_page_new),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ pub struct Widget {
|
|||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(action_tab_append: SimpleAction) -> Arc<Self> {
|
||||
pub fn new_arc(action_page_new: SimpleAction) -> Arc<Self> {
|
||||
// Init gobject
|
||||
let gobject = Button::builder()
|
||||
.icon_name("tab-new-symbolic")
|
||||
|
|
@ -22,7 +22,7 @@ impl Widget {
|
|||
|
||||
// Init events
|
||||
gobject.connect_clicked(move |_| {
|
||||
action_tab_append.activate(None);
|
||||
action_page_new.activate(None);
|
||||
});
|
||||
|
||||
Arc::new(Self { gobject })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue