Skip to content

Commit 1d6c8b2

Browse files
committed
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 #1616
1 parent f641e20 commit 1d6c8b2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

native/src/widget/checkbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ where
6767
/// * a function that will be called when the [`Checkbox`] is toggled. It
6868
/// will receive the new state of the [`Checkbox`] and must produce a
6969
/// `Message`.
70-
pub fn new<F>(is_checked: bool, label: impl Into<String>, f: F) -> Self
70+
pub fn new<F>(label: impl Into<String>,is_checked: bool, f: F) -> Self
7171
where
7272
F: 'a + Fn(bool) -> Message,
7373
{

native/src/widget/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ where
129129
Renderer: crate::text::Renderer,
130130
Renderer::Theme: widget::checkbox::StyleSheet + widget::text::StyleSheet,
131131
{
132-
widget::Checkbox::new(is_checked, label, f)
132+
widget::Checkbox::new(label, is_checked, f)
133133
}
134134

135135
/// Creates a new [`Radio`].

0 commit comments

Comments
 (0)