mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15: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
|
|
@ -1,20 +1,24 @@
|
|||
mod back;
|
||||
mod forward;
|
||||
mod widget;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let history = Box::builder()
|
||||
.orientation(gtk::Orientation::Horizontal)
|
||||
.css_classes([
|
||||
"linked", // merge childs
|
||||
])
|
||||
.build();
|
||||
|
||||
// Compose childs
|
||||
history.append(&back::new());
|
||||
history.append(&forward::new());
|
||||
|
||||
history
|
||||
pub struct History {
|
||||
widget: widget::History,
|
||||
}
|
||||
|
||||
impl History {
|
||||
// Construct
|
||||
pub fn new() -> History {
|
||||
Self {
|
||||
widget: widget::History::new(
|
||||
back::Back::new().widget().gtk(),
|
||||
forward::Forward::new().widget().gtk(),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn widget(&self) -> &widget::History {
|
||||
&self.widget
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue