Skip to content

Commit

Permalink
use same name & order for checkbox::new and helper
Browse files Browse the repository at this point in the history
The helper function for the checkbox widget switched the order
and name of the arguments passed when creating the checkbox
widget. This just standardizes the order whether the dev is using
the helper or the associated function.

Continuation of iced-rs#1616
  • Loading branch information
13r0ck committed Jan 4, 2023
1 parent f641e20 commit d8536e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion native/src/widget/checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ where
/// * a function that will be called when the [`Checkbox`] is toggled. It
/// will receive the new state of the [`Checkbox`] and must produce a
/// `Message`.
pub fn new<F>(is_checked: bool, label: impl Into<String>, f: F) -> Self
pub fn new<F>(label: impl Into<String>, is_checked: bool, f: F) -> Self
where
F: 'a + Fn(bool) -> Message,
{
Expand Down
2 changes: 1 addition & 1 deletion native/src/widget/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ where
Renderer: crate::text::Renderer,
Renderer::Theme: widget::checkbox::StyleSheet + widget::text::StyleSheet,
{
widget::Checkbox::new(is_checked, label, f)
widget::Checkbox::new(label, is_checked, f)
}

/// Creates a new [`Radio`].
Expand Down

0 comments on commit d8536e6

Please sign in to comment.