Merge pull request #1633 from pop-os/standardize-checkbox-functions
use same name & order for checkbox::new and helper
This commit is contained in:
commit
d29849df79
2 changed files with 3 additions and 3 deletions
|
|
@ -27,7 +27,7 @@ pub use iced_style::checkbox::{Appearance, StyleSheet};
|
||||||
///
|
///
|
||||||
/// let is_checked = true;
|
/// let is_checked = true;
|
||||||
///
|
///
|
||||||
/// Checkbox::new(is_checked, "Toggle me!", Message::CheckboxToggled);
|
/// Checkbox::new("Toggle me!", is_checked, Message::CheckboxToggled);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// 
|
/// 
|
||||||
|
|
@ -67,7 +67,7 @@ where
|
||||||
/// * a function that will be called when the [`Checkbox`] is toggled. It
|
/// * a function that will be called when the [`Checkbox`] is toggled. It
|
||||||
/// will receive the new state of the [`Checkbox`] and must produce a
|
/// will receive the new state of the [`Checkbox`] and must produce a
|
||||||
/// `Message`.
|
/// `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
|
where
|
||||||
F: 'a + Fn(bool) -> Message,
|
F: 'a + Fn(bool) -> Message,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ where
|
||||||
Renderer: crate::text::Renderer,
|
Renderer: crate::text::Renderer,
|
||||||
Renderer::Theme: widget::checkbox::StyleSheet + widget::text::StyleSheet,
|
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`].
|
/// Creates a new [`Radio`].
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue