mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
begin actions encapsulation
This commit is contained in:
parent
832b90d37d
commit
b56b6e3879
6 changed files with 83 additions and 40 deletions
|
|
@ -1,6 +1,7 @@
|
|||
mod menu;
|
||||
mod tab;
|
||||
|
||||
use gtk::gio::SimpleAction;
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::{Box, Orientation};
|
||||
use menu::Menu;
|
||||
|
|
@ -11,10 +12,12 @@ pub struct Tray {
|
|||
}
|
||||
|
||||
impl Tray {
|
||||
pub fn new() -> Self {
|
||||
let menu = Menu::new();
|
||||
pub fn new(action_debug: &SimpleAction, action_quit: &SimpleAction) -> Self {
|
||||
// Init components
|
||||
let menu = Menu::new(action_debug, action_quit);
|
||||
let tab = Tab::new();
|
||||
|
||||
// Init widget
|
||||
let widget = Box::builder()
|
||||
.orientation(Orientation::Horizontal)
|
||||
.spacing(8)
|
||||
|
|
@ -23,6 +26,7 @@ impl Tray {
|
|||
widget.append(menu.widget());
|
||||
widget.append(tab.widget());
|
||||
|
||||
// Return new struct
|
||||
Self { widget }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue