diff options
Diffstat (limited to 'graphics/src/widget')
-rw-r--r-- | graphics/src/widget/button.rs | 2 | ||||
-rw-r--r-- | graphics/src/widget/canvas/path/builder.rs | 2 | ||||
-rw-r--r-- | graphics/src/widget/slider.rs | 4 | ||||
-rw-r--r-- | graphics/src/widget/text.rs | 4 | ||||
-rw-r--r-- | graphics/src/widget/text_input.rs | 6 |
5 files changed, 7 insertions, 11 deletions
diff --git a/graphics/src/widget/button.rs b/graphics/src/widget/button.rs index aeb862d5..ecabc868 100644 --- a/graphics/src/widget/button.rs +++ b/graphics/src/widget/button.rs @@ -103,7 +103,7 @@ where } else { content }, - if is_mouse_over { + if is_mouse_over && !is_disabled { mouse::Interaction::Pointer } else { mouse::Interaction::default() diff --git a/graphics/src/widget/canvas/path/builder.rs b/graphics/src/widget/canvas/path/builder.rs index 6511fa52..e0e52845 100644 --- a/graphics/src/widget/canvas/path/builder.rs +++ b/graphics/src/widget/canvas/path/builder.rs @@ -84,7 +84,7 @@ impl Builder { radii: math::Vector::new(arc.radii.x, arc.radii.y), x_rotation: math::Angle::radians(arc.rotation), start_angle: math::Angle::radians(arc.start_angle), - sweep_angle: math::Angle::radians(arc.end_angle), + sweep_angle: math::Angle::radians(arc.end_angle - arc.start_angle), }; let _ = self.raw.move_to(arc.sample(0.0)); diff --git a/graphics/src/widget/slider.rs b/graphics/src/widget/slider.rs index b00cde9a..da8b5a86 100644 --- a/graphics/src/widget/slider.rs +++ b/graphics/src/widget/slider.rs @@ -16,8 +16,8 @@ pub use iced_style::slider::{Handle, HandleShape, Style, StyleSheet}; /// values. /// /// This is an alias of an `iced_native` slider with an `iced_wgpu::Renderer`. -pub type Slider<'a, Message, Backend> = - iced_native::Slider<'a, Message, Renderer<Backend>>; +pub type Slider<'a, T, Message, Backend> = + iced_native::Slider<'a, T, Message, Renderer<Backend>>; const HANDLE_HEIGHT: f32 = 22.0; diff --git a/graphics/src/widget/text.rs b/graphics/src/widget/text.rs index 327f8e29..7e22e680 100644 --- a/graphics/src/widget/text.rs +++ b/graphics/src/widget/text.rs @@ -20,7 +20,9 @@ where { type Font = Font; - const DEFAULT_SIZE: u16 = 20; + fn default_size(&self) -> u16 { + self.backend().default_size() + } fn measure( &self, diff --git a/graphics/src/widget/text_input.rs b/graphics/src/widget/text_input.rs index f13f6606..575d67f5 100644 --- a/graphics/src/widget/text_input.rs +++ b/graphics/src/widget/text_input.rs @@ -27,14 +27,8 @@ impl<B> text_input::Renderer for Renderer<B> where B: Backend + backend::Text, { - type Font = Font; type Style = Box<dyn StyleSheet>; - fn default_size(&self) -> u16 { - // TODO: Make this configurable - 20 - } - fn measure_value(&self, value: &str, size: u16, font: Font) -> f32 { let backend = self.backend(); |