mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
use modern (2018) pattern for modules
This commit is contained in:
parent
1627902b8f
commit
cdc3fe3388
28 changed files with 0 additions and 0 deletions
|
|
@ -1,36 +0,0 @@
|
|||
mod subject;
|
||||
mod tray;
|
||||
|
||||
use subject::Subject;
|
||||
use tray::Tray;
|
||||
|
||||
use gtk::{glib::GString, HeaderBar};
|
||||
|
||||
pub struct Header {
|
||||
widget: HeaderBar,
|
||||
subject: Subject,
|
||||
}
|
||||
|
||||
impl Header {
|
||||
// Construct
|
||||
pub fn new() -> Self {
|
||||
let tray = Tray::new();
|
||||
let subject = Subject::new();
|
||||
|
||||
let widget = HeaderBar::builder().build();
|
||||
widget.pack_start(tray.widget());
|
||||
widget.set_title_widget(Some(subject.widget()));
|
||||
|
||||
Self { widget, subject }
|
||||
}
|
||||
|
||||
// Actions
|
||||
pub fn update(&self, title: Option<GString>, description: Option<GString>) {
|
||||
self.subject.update(title, description);
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn widget(&self) -> &HeaderBar {
|
||||
&self.widget
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue