diff --git a/src/browser/main/tab/page/meta.rs b/src/browser/main/tab/page/meta.rs new file mode 100644 index 00000000..b64e313a --- /dev/null +++ b/src/browser/main/tab/page/meta.rs @@ -0,0 +1,26 @@ +use gtk::glib::GString; +use std::cell::RefCell; + +pub enum Mime { + Undefined, + TextGemini, + TextPlain, +} + +pub struct Meta { + pub title: GString, + pub description: GString, + pub mime: Mime, + pub progress_fraction: f32, +} + +impl Meta { + pub fn new() -> RefCell { + RefCell::new(Self { + title: GString::new(), + description: GString::new(), + mime: Mime::Undefined, + progress_fraction: 0.0, + }) + } +} diff --git a/src/browser/main/tab/page/mod.rs b/src/browser/main/tab/page/mod.rs index 48d6193a..b87f973f 100644 --- a/src/browser/main/tab/page/mod.rs +++ b/src/browser/main/tab/page/mod.rs @@ -1,7 +1,9 @@ mod content; +mod meta; mod navigation; use content::Content; +use meta::{Meta, Mime}; use navigation::Navigation; use gtk::{ @@ -16,18 +18,6 @@ use gtk::{ use std::{cell::RefCell, sync::Arc}; // Extras -enum Mime { - Undefined, - TextGemini, - TextPlain, -} - -struct Meta { - title: GString, - description: GString, - mime: Mime, - progress_fraction: f32, -} // Main pub struct Page { @@ -57,12 +47,7 @@ impl Page { widget.append(content.widget()); // Init meta - let meta = RefCell::new(Meta { - title: GString::new(), - description: GString::new(), - mime: Mime::Undefined, - progress_fraction: 0.0, - }); + let meta = Meta::new(); // Result Arc::new(Self {