mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
define actions in arc container
This commit is contained in:
parent
7c78396328
commit
9a3ad366af
10 changed files with 138 additions and 77 deletions
|
|
@ -1,27 +1,34 @@
|
|||
mod menu;
|
||||
mod tab;
|
||||
|
||||
use gtk::gio::SimpleAction;
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::{Box, Orientation};
|
||||
use menu::Menu;
|
||||
use tab::Tab;
|
||||
|
||||
use gtk::{
|
||||
gio::SimpleAction,
|
||||
prelude::BoxExt,
|
||||
{Box, Orientation},
|
||||
};
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Tray {
|
||||
widget: Box,
|
||||
}
|
||||
|
||||
impl Tray {
|
||||
pub fn new(
|
||||
action_debug: &SimpleAction,
|
||||
action_quit: &SimpleAction,
|
||||
action_tab_append: &SimpleAction,
|
||||
action_tab_close: &SimpleAction,
|
||||
action_tab_close_all: &SimpleAction,
|
||||
action_tab_page_reload: &SimpleAction,
|
||||
action_tab_pin: &SimpleAction,
|
||||
action_debug: Arc<SimpleAction>,
|
||||
action_quit: Arc<SimpleAction>,
|
||||
action_tab_append: Arc<SimpleAction>,
|
||||
action_tab_close: Arc<SimpleAction>,
|
||||
action_tab_close_all: Arc<SimpleAction>,
|
||||
action_tab_page_reload: Arc<SimpleAction>,
|
||||
action_tab_pin: Arc<SimpleAction>,
|
||||
) -> Self {
|
||||
// Init components
|
||||
let tab = Tab::new(action_tab_append.clone());
|
||||
|
||||
let menu = Menu::new(
|
||||
action_debug,
|
||||
action_quit,
|
||||
|
|
@ -32,8 +39,6 @@ impl Tray {
|
|||
action_tab_pin,
|
||||
);
|
||||
|
||||
let tab = Tab::new(action_tab_append);
|
||||
|
||||
// Init widget
|
||||
let widget = Box::builder()
|
||||
.orientation(Orientation::Horizontal)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue