Pull Checkbox default constants from its Renderer

This commit is contained in:
Héctor Ramón Jiménez 2020-02-18 02:28:15 +01:00
parent 668f627532
commit 6922160423
6 changed files with 28 additions and 31 deletions

View file

@ -3,14 +3,11 @@ use iced_native::{
checkbox, HorizontalAlignment, MouseCursor, Rectangle, VerticalAlignment,
};
const SIZE: f32 = 28.0;
impl checkbox::Renderer for Renderer {
type Style = Box<dyn StyleSheet>;
fn default_size(&self) -> u32 {
SIZE as u32
}
const DEFAULT_SIZE: u16 = 20;
const DEFAULT_SPACING: u16 = 15;
fn draw(
&mut self,

View file

@ -6,13 +6,8 @@ use iced_native::{
use std::f32;
// TODO: Obtain from renderer configuration
const DEFAULT_TEXT_SIZE: f32 = 20.0;
impl text::Renderer for Renderer {
fn default_size(&self) -> u16 {
DEFAULT_TEXT_SIZE as u16
}
const DEFAULT_SIZE: u16 = 20;
fn measure(
&self,