mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
reorganize widget modules
This commit is contained in:
parent
b9b226cc54
commit
4903968309
47 changed files with 352 additions and 786 deletions
|
|
@ -4,27 +4,47 @@ mod history;
|
|||
mod reload;
|
||||
mod request;
|
||||
|
||||
mod widget;
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::{Box, Orientation};
|
||||
|
||||
use base::Base;
|
||||
use bookmark::Bookmark;
|
||||
use history::History;
|
||||
use reload::Reload;
|
||||
use request::Request;
|
||||
|
||||
pub struct Navigation {
|
||||
widget: widget::Navigation,
|
||||
widget: Box,
|
||||
}
|
||||
|
||||
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(),
|
||||
),
|
||||
}
|
||||
let base = Base::new();
|
||||
let history = History::new();
|
||||
let reload = Reload::new();
|
||||
let request = Request::new();
|
||||
let bookmark = Bookmark::new();
|
||||
|
||||
let widget = Box::builder()
|
||||
.orientation(Orientation::Horizontal)
|
||||
.spacing(8)
|
||||
.margin_top(8)
|
||||
.margin_start(8)
|
||||
.margin_end(8)
|
||||
.margin_bottom(8)
|
||||
.build();
|
||||
|
||||
widget.append(base.widget());
|
||||
widget.append(history.widget());
|
||||
widget.append(reload.widget());
|
||||
widget.append(request.widget());
|
||||
widget.append(bookmark.widget());
|
||||
|
||||
Self { widget }
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn widget(&self) -> &widget::Navigation {
|
||||
pub fn widget(&self) -> &Box {
|
||||
&self.widget
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue