reorganize widget modules

This commit is contained in:
yggverse 2024-09-23 18:51:48 +03:00
parent b9b226cc54
commit 4903968309
47 changed files with 352 additions and 786 deletions

View file

@ -1,24 +1,34 @@
mod description;
mod title;
mod widget;
use description::Description;
use gtk::prelude::BoxExt;
use gtk::{Align, Box, Orientation};
use title::Title;
pub struct Subject {
widget: widget::Subject,
widget: Box,
}
impl Subject {
// Construct
pub fn new() -> Subject {
Self {
widget: widget::Subject::new(
title::Title::new().widget().gtk(),
description::Description::new().widget().gtk(),
),
}
let title = Title::new();
let description = Description::new();
let widget = Box::builder()
.orientation(Orientation::Vertical)
.valign(Align::Center)
.build();
widget.append(title.widget());
widget.append(description.widget());
Self { widget }
}
// Getters
pub fn widget(&self) -> &widget::Subject {
pub fn widget(&self) -> &Box {
&self.widget
}
}