summaryrefslogtreecommitdiffstats
path: root/examples/custom_widget
diff options
context:
space:
mode:
Diffstat (limited to 'examples/custom_widget')
-rw-r--r--examples/custom_widget/src/main.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/custom_widget/src/main.rs b/examples/custom_widget/src/main.rs
index 3cf10e22..dc3f74ac 100644
--- a/examples/custom_widget/src/main.rs
+++ b/examples/custom_widget/src/main.rs
@@ -12,8 +12,9 @@ mod circle {
use iced::advanced::layout::{self, Layout};
use iced::advanced::renderer;
use iced::advanced::widget::{self, Widget};
+ use iced::border;
use iced::mouse;
- use iced::{Border, Color, Element, Length, Rectangle, Size};
+ use iced::{Color, Element, Length, Rectangle, Size};
pub struct Circle {
radius: f32,
@@ -62,7 +63,7 @@ mod circle {
renderer.fill_quad(
renderer::Quad {
bounds: layout.bounds(),
- border: Border::rounded(self.radius),
+ border: border::rounded(self.radius),
..renderer::Quad::default()
},
Color::BLACK,
@@ -83,7 +84,7 @@ mod circle {
use circle::circle;
use iced::widget::{center, column, slider, text};
-use iced::{Alignment, Element};
+use iced::{Center, Element};
pub fn main() -> iced::Result {
iced::run("Custom Widget - Iced", Example::update, Example::view)
@@ -120,7 +121,7 @@ impl Example {
.padding(20)
.spacing(20)
.max_width(500)
- .align_items(Alignment::Center);
+ .align_x(Center);
center(content).into()
}