summaryrefslogtreecommitdiffstats
path: root/examples/custom_widget.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-01-09 18:46:06 +0100
committerLibravatar GitHub <noreply@github.com>2020-01-09 18:46:06 +0100
commit0a8302450557877cb667b51fc84383aaf0a11b02 (patch)
treefe3a8a6b0ae82f7fd1fa0c0de34b4b09d0b9edda /examples/custom_widget.rs
parent6699329d3f91c5b9d8e8e55ad88de24bd3894955 (diff)
parent7b278755fc7929633b5771824beac4d39b16e82e (diff)
downloadiced-0a8302450557877cb667b51fc84383aaf0a11b02.tar.gz
iced-0a8302450557877cb667b51fc84383aaf0a11b02.tar.bz2
iced-0a8302450557877cb667b51fc84383aaf0a11b02.zip
Merge pull request #146 from hecrj/feature/custom-styling
Custom styling
Diffstat (limited to 'examples/custom_widget.rs')
-rw-r--r--examples/custom_widget.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/custom_widget.rs b/examples/custom_widget.rs
index c0038cd9..0a570745 100644
--- a/examples/custom_widget.rs
+++ b/examples/custom_widget.rs
@@ -13,7 +13,7 @@ mod circle {
layout, Background, Color, Element, Hasher, Layout, Length,
MouseCursor, Point, Size, Widget,
};
- use iced_wgpu::{Primitive, Renderer};
+ use iced_wgpu::{Defaults, Primitive, Renderer};
pub struct Circle {
radius: u16,
@@ -54,6 +54,7 @@ mod circle {
fn draw(
&self,
_renderer: &mut Renderer,
+ _defaults: &Defaults,
layout: Layout<'_>,
_cursor_position: Point,
) -> (Primitive, MouseCursor) {
@@ -62,6 +63,8 @@ mod circle {
bounds: layout.bounds(),
background: Background::Color(Color::BLACK),
border_radius: self.radius,
+ border_width: 0,
+ border_color: Color::TRANSPARENT,
},
MouseCursor::OutOfBounds,
)