Rewrite using Relm4

Yes, this is a monster commit but at this stage I'm the only one working
on this project anyway. Further commits will follow Best Practises™
again.
This commit is contained in:
Reinout Meliesie 2026-01-21 13:20:47 +01:00
commit 4d4b7eb1c7
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
43 changed files with 2159 additions and 1248 deletions

View file

@ -0,0 +1,41 @@
use gtk4::prelude::{BoxExt, OrientableExt, WidgetExt};
use gtk4::{Label, Orientation};
use relm4::{ComponentParts, ComponentSender, RelmWidgetExt, SimpleComponent, component};
use crate::views::overview::SeriesOverview;
pub struct SeriesDetails {
series_overview: SeriesOverview,
}
#[component(pub)]
impl SimpleComponent for SeriesDetails {
type Init = SeriesOverview;
type Input = ();
type Output = ();
view! {
gtk4::Box {
set_orientation: Orientation::Vertical,
set_spacing: 40,
set_margin_all: 100,
Label {
set_css_classes: &["title-1"],
set_label: model.series_overview.name.as_str(),
}
}
}
fn init(
series_overview: SeriesOverview,
_root: gtk4::Box,
_sender: ComponentSender<SeriesDetails>,
) -> ComponentParts<SeriesDetails> {
let model = SeriesDetails { series_overview };
let widgets = view_output!();
ComponentParts { model, widgets }
}
}