mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
create separated structs for subject entity
This commit is contained in:
parent
6f3ad01c35
commit
2c389abdfd
7 changed files with 147 additions and 55 deletions
|
|
@ -1,20 +1,24 @@
|
|||
mod description;
|
||||
mod title;
|
||||
mod widget;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let subject = Box::builder()
|
||||
// Tuneup
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
|
||||
// Compose childs
|
||||
subject.append(&title::new());
|
||||
subject.append(&description::new());
|
||||
|
||||
// Done
|
||||
subject
|
||||
pub struct Subject {
|
||||
widget: widget::Subject,
|
||||
}
|
||||
|
||||
impl Subject {
|
||||
// Construct
|
||||
pub fn new() -> Subject {
|
||||
Self {
|
||||
widget: widget::Subject::new(
|
||||
title::Title::new().widget().gtk(),
|
||||
description::Description::new().widget().gtk(),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn widget(&self) -> &widget::Subject {
|
||||
&self.widget
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue