draft header update on page reload

This commit is contained in:
yggverse 2024-09-25 22:19:48 +03:00
parent 8977adab77
commit ca74a29ffa
6 changed files with 72 additions and 10 deletions

View file

@ -2,12 +2,14 @@ mod description;
mod title;
use description::Description;
use gtk::prelude::BoxExt;
use gtk::{Align, Box, Orientation};
use title::Title;
use gtk::{glib::GString, prelude::BoxExt, Align, Box, Orientation};
pub struct Subject {
widget: Box,
title: Title,
description: Description,
}
impl Subject {
@ -24,7 +26,17 @@ impl Subject {
widget.append(title.widget());
widget.append(description.widget());
Self { widget }
Self {
widget,
title,
description,
}
}
// Actions
pub fn update(&self, title: GString, description: GString) {
self.title.update(&title);
self.description.update(&description);
}
// Getters