mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
begin actions encapsulation
This commit is contained in:
parent
832b90d37d
commit
b56b6e3879
6 changed files with 83 additions and 40 deletions
|
|
@ -4,7 +4,7 @@ mod tray;
|
|||
use subject::Subject;
|
||||
use tray::Tray;
|
||||
|
||||
use gtk::{glib::GString, HeaderBar};
|
||||
use gtk::{gio::SimpleAction, glib::GString, HeaderBar};
|
||||
|
||||
pub struct Header {
|
||||
widget: HeaderBar,
|
||||
|
|
@ -13,14 +13,18 @@ pub struct Header {
|
|||
|
||||
impl Header {
|
||||
// Construct
|
||||
pub fn new() -> Self {
|
||||
let tray = Tray::new();
|
||||
pub fn new(action_debug: &SimpleAction, action_quit: &SimpleAction) -> Self {
|
||||
// Init components
|
||||
let tray = Tray::new(action_debug, action_quit);
|
||||
|
||||
let subject = Subject::new();
|
||||
|
||||
// Init widget
|
||||
let widget = HeaderBar::builder().build();
|
||||
widget.pack_start(tray.widget());
|
||||
widget.set_title_widget(Some(subject.widget()));
|
||||
|
||||
// Return new struct
|
||||
Self { widget, subject }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue