complete widget submodule refactory

This commit is contained in:
yggverse 2024-09-22 22:23:44 +03:00
parent e45b7f0a4a
commit 1e42a75f2e
29 changed files with 585 additions and 145 deletions

View file

@ -4,26 +4,27 @@ mod history;
mod reload;
mod request;
use gtk::prelude::BoxExt;
use gtk::Box;
mod widget;
pub fn new() -> Box {
let navigation = Box::builder()
// Tuneup
.orientation(gtk::Orientation::Horizontal)
.spacing(8)
.margin_top(8)
.margin_start(8)
.margin_end(8)
.margin_bottom(8)
.build();
// Compose childs
navigation.append(&base::new());
navigation.append(&history::new());
navigation.append(&reload::new());
navigation.append(&request::new());
navigation.append(&bookmark::new());
navigation
pub struct Navigation {
widget: widget::Navigation,
}
impl Navigation {
pub fn new() -> Navigation {
Self {
widget: widget::Navigation::new(
base::Base::new().widget().gtk(),
history::History::new().widget().gtk(),
reload::Reload::new().widget().gtk(),
request::Request::new().widget().gtk(),
bookmark::Bookmark::new().widget().gtk(),
),
}
}
// Getters
pub fn widget(&self) -> &widget::Navigation {
&self.widget
}
}