From 652671407eec384a8ef96097ca7fa1d0c83215ef Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 23 Sep 2024 13:50:59 +0300 Subject: [PATCH] construct header component and return arc ptr --- src/browser/header/mod.rs | 9 ++++++--- src/browser/mod.rs | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/browser/header/mod.rs b/src/browser/header/mod.rs index dc96671b..dba26dc1 100644 --- a/src/browser/header/mod.rs +++ b/src/browser/header/mod.rs @@ -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
{ + Arc::new(Self { widget: widget::Header::new( tray::Tray::new().widget().gtk(), subject::Subject::new().widget().gtk(), ), - } + }) } // Getters diff --git a/src/browser/mod.rs b/src/browser/mod.rs index 0d093d2f..f1254f92 100644 --- a/src/browser/mod.rs +++ b/src/browser/mod.rs @@ -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, widget: widget::Browser, + // Components + header: Arc, + main: Arc, } impl Browser { @@ -62,9 +64,9 @@ impl Browser { // Return Self { db, + widget, header, main, - widget, } }