summaryrefslogtreecommitdiffstats
path: root/graphics/src/widget/checkbox.rs
blob: 3b75652539757a4626f2e96f727c0c34eaeb5fbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Show toggle controls using checkboxes.
use crate::backend::{self, Backend};
use crate::Renderer;

use iced_native::checkbox;

pub use iced_style::checkbox::{Style, StyleSheet};

/// A box that can be checked.
///
/// This is an alias of an `iced_native` checkbox with an `iced_wgpu::Renderer`.
pub type Checkbox<Message, Backend> =
    iced_native::Checkbox<Message, Renderer<Backend>>;

impl<B> checkbox::Renderer for Renderer<B>
where
    B: Backend + backend::Text,
{
    type Style = Box<dyn StyleSheet>;

    const DEFAULT_SIZE: u16 = 20;
    const DEFAULT_SPACING: u16 = 15;
}