Browse Source

construct header component and return arc ptr

master
yggverse 2 months ago
parent
commit
652671407e
  1. 9
      src/browser/header/mod.rs
  2. 8
      src/browser/mod.rs

9
src/browser/header/mod.rs

@ -2,18 +2,21 @@ mod subject; @@ -2,18 +2,21 @@ mod subject;
mod tray;
mod widget;
use std::sync::Arc;
pub struct Header {
widget: widget::Header,
}
impl Header {
pub fn new() -> Header {
Self {
// Construct
pub fn new() -> Arc<Header> {
Arc::new(Self {
widget: widget::Header::new(
tray::Tray::new().widget().gtk(),
subject::Subject::new().widget().gtk(),
),
}
})
}
// Getters

8
src/browser/mod.rs

@ -10,10 +10,12 @@ use std::sync::Arc; @@ -10,10 +10,12 @@ use std::sync::Arc;
use gtk::prelude::{ActionMapExtManual, GtkWindowExt};
pub struct Browser {
// Extras
db: db::Browser,
header: header::Header,
main: Arc<main::Main>,
widget: widget::Browser,
// Components
header: Arc<header::Header>,
main: Arc<main::Main>,
}
impl Browser {
@ -62,9 +64,9 @@ impl Browser { @@ -62,9 +64,9 @@ impl Browser {
// Return
Self {
db,
widget,
header,
main,
widget,
}
}

Loading…
Cancel
Save