Remove Renderer trait for Checkbox

This commit is contained in:
Héctor Ramón Jiménez 2021-10-21 18:50:27 +07:00
parent b6ae87ae55
commit 7c08c6bd13
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
8 changed files with 40 additions and 82 deletions

View file

@ -1,23 +1,10 @@
//! 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;
}
pub type Checkbox<'a, Message, Backend> =
iced_native::Checkbox<'a, Message, Renderer<Backend>>;