Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micro components #50

Merged
merged 8 commits into from Nov 20, 2021
Merged

Micro components #50

merged 8 commits into from Nov 20, 2021

Conversation

mskorkowski
Copy link
Contributor

Implementation of #49

It's required to make #46 go forward

src/micro_component.rs Outdated Show resolved Hide resolved
Comment on lines 72 to 74
pub fn update_view(&self) {
todo!()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as in the event loop. Try to acquire the widgets and the model and then call view. This function could theoretically return a Result instead of error handling through logs.

- Removed unneeded Option from model and widgets,
- implemented `update_view`
Currently only the handler of events is interested in the `data`
which makes `data` a `dead_code`. So I've commented it out
- gtk from 0.3 to 0.3.1
- libadwaita from 0.1.0-alpha-5 to 0.1.0-alpha-6
@mskorkowski mskorkowski changed the title [WIP] Micro components Micro components Nov 7, 2021
@mskorkowski mskorkowski marked this pull request as ready for review November 7, 2021 17:39
Copy link
Member

@AaronErhardt AaronErhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and should be ready to merge. I will write an example for micro components and refine the API if necessary soon.

/// Formats [`MicroComponentError`] for debug format `{:?}`
///
/// This allows you to print errors without doing `matching` or `if let` statements
impl Debug for MicroComponentError {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to manually implement this? I think using #derive[Debug] should do the same.

@AaronErhardt AaronErhardt merged commit 4d34db1 into Relm4:main Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants