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;
mod tray; mod tray;
mod widget; mod widget;
use std::sync::Arc;
pub struct Header { pub struct Header {
widget: widget::Header, widget: widget::Header,
} }
impl Header { impl Header {
pub fn new() -> Header { // Construct
Self { pub fn new() -> Arc<Header> {
Arc::new(Self {
widget: widget::Header::new( widget: widget::Header::new(
tray::Tray::new().widget().gtk(), tray::Tray::new().widget().gtk(),
subject::Subject::new().widget().gtk(), subject::Subject::new().widget().gtk(),
), ),
} })
} }
// Getters // Getters

8
src/browser/mod.rs

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

Loading…
Cancel
Save