diff --git a/src/app/browser/window/tab/item.rs b/src/app/browser/window/tab/item.rs index cae68073..85f7dfe0 100644 --- a/src/app/browser/window/tab/item.rs +++ b/src/app/browser/window/tab/item.rs @@ -67,7 +67,7 @@ impl Item { let widget = Rc::new(Widget::build( tab_view, - &page.widget.g_box, + &page.g_box, None, position, (is_pinned, is_selected, is_attention), diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 54aaf5ad..90d5f71f 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -4,17 +4,16 @@ mod error; mod input; mod navigation; mod search; -mod widget; use super::{Action as ItemAction, BrowserAction, Profile, TabAction, WindowAction}; use content::Content; use error::Error; +use gtk::{prelude::BoxExt, Box, Orientation}; use input::Input; use navigation::Navigation; use search::Search; use sqlite::Transaction; use std::rc::Rc; -use widget::Widget; pub struct Page { pub profile: Rc, @@ -27,7 +26,7 @@ pub struct Page { pub search: Rc, pub input: Rc, pub navigation: Rc, - pub widget: Rc, + pub g_box: Box, } impl Page { @@ -54,12 +53,13 @@ impl Page { let input = Rc::new(Input::new()); - let widget = Rc::new(Widget::build( - &navigation.g_box, - &content.g_box, - &search.g_box, - &input.clamp, - )); + // Init main widget + let g_box = Box::builder().orientation(Orientation::Vertical).build(); + + g_box.append(&navigation.g_box); + g_box.append(&content.g_box); + g_box.append(&search.g_box); + g_box.append(&input.clamp); // Done Self { @@ -73,7 +73,8 @@ impl Page { search, input, navigation, - widget, + // Widget + g_box, } } diff --git a/src/app/browser/window/tab/item/page/widget.rs b/src/app/browser/window/tab/item/page/widget.rs deleted file mode 100644 index a88a6d5e..00000000 --- a/src/app/browser/window/tab/item/page/widget.rs +++ /dev/null @@ -1,31 +0,0 @@ -use gtk::{ - prelude::{BoxExt, IsA}, - Box, Orientation, -}; - -pub struct Widget { - pub g_box: Box, -} - -impl Widget { - // Constructors - - /// Build new `Self` - pub fn build( - // Components - navigation: &impl IsA, - content: &impl IsA, - search: &impl IsA, - input: &impl IsA, - ) -> Self { - // Init self - let g_box = Box::builder().orientation(Orientation::Vertical).build(); - - g_box.append(navigation); - g_box.append(content); - g_box.append(search); - g_box.append(input); - - Self { g_box } - } -}