Remove Sandbox trait 🎉
This commit is contained in:
parent
9152904af1
commit
846d76cd3f
13 changed files with 169 additions and 240 deletions
|
|
@ -10,7 +10,7 @@ pub fn main() -> iced::Result {
|
|||
iced::application("Arc - Iced", Arc::update, Arc::view)
|
||||
.subscription(Arc::subscription)
|
||||
.theme(|_| Theme::Dark)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use iced::{Alignment, Element, Length};
|
|||
|
||||
pub fn main() -> iced::Result {
|
||||
iced::application("Bezier Tool - Iced", Example::update, Example::view)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ pub fn main() -> iced::Result {
|
|||
iced::application("Clock - Iced", Clock::update, Clock::view)
|
||||
.subscription(Clock::subscription)
|
||||
.theme(Clock::theme)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pub fn main() -> iced::Result {
|
|||
)
|
||||
.theme(ColorPalette::theme)
|
||||
.default_font(Font::MONOSPACE)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use iced::{Alignment, Command, Element, Length, Subscription};
|
|||
pub fn main() -> iced::Result {
|
||||
iced::application("Events - Iced", Events::update, Events::view)
|
||||
.subscription(Events::subscription)
|
||||
.ignore_close_request()
|
||||
.exit_on_close_request(false)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,17 @@
|
|||
use iced::application;
|
||||
use iced::gradient;
|
||||
use iced::widget::{
|
||||
checkbox, column, container, horizontal_space, row, slider, text,
|
||||
};
|
||||
use iced::{gradient, window};
|
||||
use iced::{
|
||||
Alignment, Color, Element, Length, Radians, Sandbox, Settings, Theme,
|
||||
};
|
||||
use iced::{Alignment, Color, Element, Length, Radians, Theme};
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
Gradient::run(Settings {
|
||||
window: window::Settings {
|
||||
transparent: true,
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
iced::application("Gradient - Iced", Gradient::update, Gradient::view)
|
||||
.style(Gradient::style)
|
||||
.transparent(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
@ -35,9 +30,7 @@ enum Message {
|
|||
TransparentToggled(bool),
|
||||
}
|
||||
|
||||
impl Sandbox for Gradient {
|
||||
type Message = Message;
|
||||
|
||||
impl Gradient {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
start: Color::WHITE,
|
||||
|
|
@ -47,10 +40,6 @@ impl Sandbox for Gradient {
|
|||
}
|
||||
}
|
||||
|
||||
fn title(&self) -> String {
|
||||
String::from("Gradient")
|
||||
}
|
||||
|
||||
fn update(&mut self, message: Message) {
|
||||
match message {
|
||||
Message::StartChanged(color) => self.start = color,
|
||||
|
|
@ -118,6 +107,12 @@ impl Sandbox for Gradient {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for Gradient {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn color_picker(label: &str, color: Color) -> Element<'_, Color> {
|
||||
row![
|
||||
text(label).width(64),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub fn main() -> iced::Result {
|
|||
LoadingSpinners::update,
|
||||
LoadingSpinners::view,
|
||||
)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ pub fn main() -> iced::Result {
|
|||
tracing_subscriber::fmt::init();
|
||||
|
||||
iced::application("Multitouch - Iced", Multitouch::update, Multitouch::view)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.centered()
|
||||
.run()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ fn main() -> iced::Result {
|
|||
SierpinskiEmulator::update,
|
||||
SierpinskiEmulator::view,
|
||||
)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub fn main() -> iced::Result {
|
|||
VectorialText::view,
|
||||
)
|
||||
.theme(|_| Theme::Dark)
|
||||
.antialiased()
|
||||
.antialiasing(true)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue