chore: Sync with Relm4 new-approach branch

This commit is contained in:
Michael Aaron Murphy 2022-01-31 15:55:55 +01:00
parent c25812a45b
commit 3e4a00a8d8
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
12 changed files with 123 additions and 463 deletions

View file

@ -21,6 +21,7 @@ component! {
pub struct InfoButtonWidgets {
description: gtk::Label,
}
type Input = InfoButtonInput;
type Output = InfoButtonOutput;
@ -39,7 +40,7 @@ component! {
root
};
fn init(args: (String, String, gtk::SizeGroup), root, input, output) {
fn init(args: (String, String, gtk::SizeGroup), root, _input, output) {
let (desc, button_label, sg) = args;
ccs::view! {
@ -67,19 +68,23 @@ component! {
sg.add_widget(&button);
ComponentInner {
Fuselage {
model: InfoButton {},
widgets: InfoButtonWidgets { description },
input,
output,
}
}
fn update(component, message) {
fn update(&mut self, widgets, message, _input, _output) {
match message {
InfoButtonInput::SetDescription(value) => {
component.widgets.description.set_text(&value);
widgets.description.set_text(&value);
}
}
None
}
async fn command(_message: (), _input) {
}
}