mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
complete widget submodule refactory
This commit is contained in:
parent
e45b7f0a4a
commit
1e42a75f2e
29 changed files with 585 additions and 145 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue