mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-10 10:24:13 +00:00
rename widget struct entity
This commit is contained in:
parent
3d7be25c5f
commit
4b78ccb779
@ -1,24 +1,24 @@
|
||||
use gtk::prelude::BoxExt;
|
||||
|
||||
pub struct Label {
|
||||
gtk: gtk::Box,
|
||||
container: gtk::Box,
|
||||
}
|
||||
|
||||
impl Label {
|
||||
// Construct new object
|
||||
pub fn new(pin: >k::Image, title: >k::Label) -> Label {
|
||||
let gtk = gtk::Box::builder()
|
||||
let container = gtk::Box::builder()
|
||||
.orientation(gtk::Orientation::Horizontal)
|
||||
.build();
|
||||
|
||||
gtk.append(pin);
|
||||
gtk.append(title);
|
||||
container.append(pin);
|
||||
container.append(title);
|
||||
|
||||
Self { gtk }
|
||||
Self { container }
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gtk(&self) -> >k::Box {
|
||||
&self.gtk
|
||||
pub fn container(&self) -> >k::Box {
|
||||
&self.container
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ impl Tab {
|
||||
// Actions
|
||||
pub fn append(&self, current: bool) -> u32 {
|
||||
self.widget.append(
|
||||
label::Label::new().widget().gtk(),
|
||||
page::Page::new().widget().gtk(),
|
||||
label::Label::new().widget().container(),
|
||||
page::Page::new().widget().container(),
|
||||
current,
|
||||
)
|
||||
}
|
||||
|
@ -1,24 +1,24 @@
|
||||
use gtk::prelude::BoxExt;
|
||||
|
||||
pub struct Page {
|
||||
gtk: gtk::Box,
|
||||
container: gtk::Box,
|
||||
}
|
||||
|
||||
impl Page {
|
||||
// Construct
|
||||
pub fn new(navigation: >k::Box, content: >k::Box) -> Page {
|
||||
let gtk = gtk::Box::builder()
|
||||
let container = gtk::Box::builder()
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.build();
|
||||
|
||||
gtk.append(navigation);
|
||||
gtk.append(content);
|
||||
container.append(navigation);
|
||||
container.append(content);
|
||||
|
||||
Self { gtk }
|
||||
Self { container }
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gtk(&self) -> >k::Box {
|
||||
&self.gtk
|
||||
pub fn container(&self) -> >k::Box {
|
||||
&self.container
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user