From d8536e62484a2f46d0ad9b49b7141f6507d663e3 Mon Sep 17 00:00:00 2001 From: 13r0ck Date: Tue, 3 Jan 2023 11:23:58 -0700 Subject: use same name & order for checkbox::new and helper 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 https://github.com/iced-rs/iced/pull/1616 --- native/src/widget/checkbox.rs | 2 +- native/src/widget/helpers.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'native/src/widget') diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index bec5c448..96fd60ba 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -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(is_checked: bool, label: impl Into, f: F) -> Self + pub fn new(label: impl Into, is_checked: bool, f: F) -> Self where F: 'a + Fn(bool) -> Message, { diff --git a/native/src/widget/helpers.rs b/native/src/widget/helpers.rs index 5b241f83..dfd949f6 100644 --- a/native/src/widget/helpers.rs +++ b/native/src/widget/helpers.rs @@ -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`]. -- cgit