chore: add documentation to radio_button.rs and fix warning in image.rs#861
Open
AncutaIoan wants to merge 2 commits intolapce:mainfrom
Open
chore: add documentation to radio_button.rs and fix warning in image.rs#861AncutaIoan wants to merge 2 commits intolapce:mainfrom
AncutaIoan wants to merge 2 commits intolapce:mainfrom
Conversation
Author
jrmoulton
reviewed
Aug 1, 2025
Collaborator
jrmoulton
left a comment
There was a problem hiding this comment.
Thanks for helping to improve the docs! There are some good changes in here but in some other places I feel like your changes are removing clarity. Can you explain why you made the changes?
Comment on lines
-36
to
+79
| /// Creates a new radio button with a closure that determines its selected state. | ||
| /// Creates a new radio button using a closure for its current value. | ||
| /// | ||
| /// The returned value is wrapped in a [`ValueContainer`] so it can be managed declaratively. | ||
| /// | ||
| /// This method is useful when you want a radio button whose state is determined by a closure. | ||
| /// The state can be dynamically updated by the closure, and the radio button will reflect these changes. | ||
| #[allow(clippy::new_ret_no_self)] | ||
| /// # Example | ||
| /// ```rust | ||
| /// use floem::views::RadioButton; | ||
| /// use floem_reactive::{RwSignal, SignalGet}; | ||
| /// let selected = RwSignal::new("A".to_string()); | ||
| /// RadioButton::new("A".to_string(), move || selected.get()); | ||
| /// ``` |
Collaborator
There was a problem hiding this comment.
I'm not sure that this is an improvement over the previous docs. Why did you change it?
Comment on lines
-59
to
+98
| /// Use this method when you have a signal that provides the current state of the radio button. | ||
| /// The radio button will automatically update its state based on the signal. | ||
| /// Useful for when the button state is externally managed and shouldn't be changed by the user. |
Collaborator
There was a problem hiding this comment.
I don't think this is an improvement over the previous docs.
Comment on lines
-73
to
+111
| /// This method is ideal when you need a radio button that not only reflects a signal's state but also updates it. | ||
| /// Clicking the radio button will set the signal to the represented value. | ||
| /// When selected, the radio button will set the underlying signal to its represented value. |
Comment on lines
-91
to
+136
| /// Creates a new labeled radio button with a closure that determines its selected state. | ||
| /// | ||
| /// This method is useful when you want a labeled radio button whose state is determined by a closure. | ||
| /// The label is also provided by a closure, allowing for dynamic updates. | ||
| /// Creates a new **labeled** radio button from a closure and label generator. |
Collaborator
There was a problem hiding this comment.
same thing here. I think this is removing clarity.
Comment on lines
-120
to
+162
| /// Creates a new labeled radio button with a signal that provides its selected state. | ||
| /// | ||
| /// Use this method when you have a signal that provides the current state of the radio button and you also want a label. | ||
| /// The radio button and label will automatically update based on the signal. | ||
| /// Creates a read-only **labeled** radio button from a signal and label. |
Comment on lines
-141
to
+180
| /// Creates a new labeled radio button with a signal that provides and updates its selected state. | ||
| /// | ||
| /// This method is ideal when you need a labeled radio button that not only reflects a signal's state but also updates it. | ||
| /// Clicking the radio button will set the signal to the represented value. | ||
| /// Creates a reactive **labeled** radio button with two-way binding and dynamic label. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.