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:
parent
d25fdd0a32
commit
4d4b7eb1c7
43 changed files with 2159 additions and 1248 deletions
41
src/ui/components/media_details/series_details.rs
Normal file
41
src/ui/components/media_details/series_details.rs
Normal 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 }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue