Move Program to application module

This commit is contained in:
Héctor Ramón Jiménez 2024-03-17 14:16:38 +01:00
parent 7e1ef7d150
commit 54f44754eb
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
29 changed files with 58 additions and 80 deletions

View file

@ -7,7 +7,7 @@ use iced::widget::canvas::{
use iced::{Element, Length, Point, Rectangle, Renderer, Subscription, Theme};
pub fn main() -> iced::Result {
iced::application("Arc - Iced", Arc::update, Arc::view)
iced::program("Arc - Iced", Arc::update, Arc::view)
.subscription(Arc::subscription)
.theme(|_| Theme::Dark)
.antialiasing(true)

View file

@ -3,7 +3,7 @@ use iced::widget::{button, column, text};
use iced::{Alignment, Element, Length};
pub fn main() -> iced::Result {
iced::application("Bezier Tool - Iced", Example::update, Example::view)
iced::program("Bezier Tool - Iced", Example::update, Example::view)
.antialiasing(true)
.run()
}

View file

@ -4,7 +4,7 @@ use iced::{Element, Font, Length};
const ICON_FONT: Font = Font::with_name("icons");
pub fn main() -> iced::Result {
iced::application("Checkbox - Iced", Example::update, Example::view)
iced::program("Checkbox - Iced", Example::update, Example::view)
.font(include_bytes!("../fonts/icons.ttf").as_slice())
.run()
}

View file

@ -8,7 +8,7 @@ use iced::{
};
pub fn main() -> iced::Result {
iced::application("Clock - Iced", Clock::update, Clock::view)
iced::program("Clock - Iced", Clock::update, Clock::view)
.subscription(Clock::subscription)
.theme(Clock::theme)
.antialiasing(true)

View file

@ -13,7 +13,7 @@ use std::marker::PhantomData;
use std::ops::RangeInclusive;
pub fn main() -> iced::Result {
iced::application(
iced::program(
"Color Palette - Iced",
ColorPalette::update,
ColorPalette::view,

View file

@ -9,13 +9,9 @@ use iced::window;
use iced::{Alignment, Color, Element, Length, Subscription};
fn main() -> iced::Result {
iced::application(
"Custom Shader - Iced",
IcedCubes::update,
IcedCubes::view,
)
.subscription(IcedCubes::subscription)
.run()
iced::program("Custom Shader - Iced", IcedCubes::update, IcedCubes::view)
.subscription(IcedCubes::subscription)
.run()
}
struct IcedCubes {

View file

@ -4,13 +4,9 @@ use iced::widget::{button, column, container, progress_bar, text, Column};
use iced::{Alignment, Element, Length, Subscription};
pub fn main() -> iced::Result {
iced::application(
"Download Progress - Iced",
Example::update,
Example::view,
)
.subscription(Example::subscription)
.run()
iced::program("Download Progress - Iced", Example::update, Example::view)
.subscription(Example::subscription)
.run()
}
#[derive(Debug)]

View file

@ -5,7 +5,7 @@ use iced::window;
use iced::{Alignment, Command, Element, Length, Subscription};
pub fn main() -> iced::Result {
iced::application("Events - Iced", Events::update, Events::view)
iced::program("Events - Iced", Events::update, Events::view)
.subscription(Events::subscription)
.exit_on_close_request(false)
.run()

View file

@ -3,7 +3,7 @@ use iced::window;
use iced::{Alignment, Command, Element, Length};
pub fn main() -> iced::Result {
iced::application("Exit - Iced", Exit::update, Exit::view).run()
iced::program("Exit - Iced", Exit::update, Exit::view).run()
}
#[derive(Default)]

View file

@ -8,7 +8,7 @@ use iced::{Alignment, Color, Element, Length, Radians, Theme};
pub fn main() -> iced::Result {
tracing_subscriber::fmt::init();
iced::application("Gradient - Iced", Gradient::update, Gradient::view)
iced::program("Gradient - Iced", Gradient::update, Gradient::view)
.style(Gradient::style)
.transparent(true)
.run()

View file

@ -10,7 +10,7 @@ use iced::{
};
pub fn main() -> iced::Result {
iced::application(Layout::title, Layout::update, Layout::view)
iced::program(Layout::title, Layout::update, Layout::view)
.subscription(Layout::subscription)
.theme(Layout::theme)
.run()

View file

@ -11,7 +11,7 @@ use circular::Circular;
use linear::Linear;
pub fn main() -> iced::Result {
iced::application(
iced::program(
"Loading Spinners - Iced",
LoadingSpinners::update,
LoadingSpinners::view,

View file

@ -13,7 +13,7 @@ use std::collections::HashMap;
pub fn main() -> iced::Result {
tracing_subscriber::fmt::init();
iced::application("Multitouch - Iced", Multitouch::update, Multitouch::view)
iced::program("Multitouch - Iced", Multitouch::update, Multitouch::view)
.antialiasing(true)
.centered()
.run()

View file

@ -7,7 +7,7 @@ use iced::widget::{
use iced::{Color, Element, Length, Size, Subscription};
pub fn main() -> iced::Result {
iced::application("Pane Grid - Iced", Example::update, Example::view)
iced::program("Pane Grid - Iced", Example::update, Example::view)
.subscription(Example::subscription)
.run()
}

View file

@ -3,7 +3,7 @@ use iced::widget::{self, column, container, image, row, text};
use iced::{Alignment, Command, Element, Length};
pub fn main() -> iced::Result {
iced::application(Pokedex::title, Pokedex::update, Pokedex::view)
iced::program(Pokedex::title, Pokedex::update, Pokedex::view)
.load(Pokedex::search)
.run()
}

View file

@ -4,7 +4,7 @@ use iced::widget::{
use iced::{Alignment, Element, Length, Theme};
pub fn main() -> iced::Result {
iced::application(
iced::program(
"QR Code Generator - Iced",
QRGenerator::update,
QRGenerator::view,

View file

@ -13,7 +13,7 @@ use ::image::ColorType;
fn main() -> iced::Result {
tracing_subscriber::fmt::init();
iced::application("Screenshot - Iced", Example::update, Example::view)
iced::program("Screenshot - Iced", Example::update, Example::view)
.subscription(Example::subscription)
.run()
}

View file

@ -10,7 +10,7 @@ use once_cell::sync::Lazy;
static SCROLLABLE_ID: Lazy<scrollable::Id> = Lazy::new(scrollable::Id::unique);
pub fn main() -> iced::Result {
iced::application(
iced::program(
"Scrollable - Iced",
ScrollableDemo::update,
ScrollableDemo::view,

View file

@ -8,7 +8,7 @@ use rand::Rng;
use std::fmt::Debug;
fn main() -> iced::Result {
iced::application(
iced::program(
"Sierpinski Triangle - Iced",
SierpinskiEmulator::update,
SierpinskiEmulator::view,

View file

@ -22,7 +22,7 @@ use std::time::Instant;
pub fn main() -> iced::Result {
tracing_subscriber::fmt::init();
iced::application(
iced::program(
"Solar System - Iced",
SolarSystem::update,
SolarSystem::view,

View file

@ -7,7 +7,7 @@ use iced::{Alignment, Element, Length, Subscription, Theme};
use std::time::{Duration, Instant};
pub fn main() -> iced::Result {
iced::application("Stopwatch - Iced", Stopwatch::update, Stopwatch::view)
iced::program("Stopwatch - Iced", Stopwatch::update, Stopwatch::view)
.subscription(Stopwatch::subscription)
.theme(Stopwatch::theme)
.run()

View file

@ -6,7 +6,7 @@ use iced::widget::{
use iced::{Alignment, Element, Length, Theme};
pub fn main() -> iced::Result {
iced::application("Styling - Iced", Styling::update, Styling::view)
iced::program("Styling - Iced", Styling::update, Styling::view)
.theme(Styling::theme)
.run()
}

View file

@ -2,12 +2,8 @@ use iced::widget::{button, column, container, text};
use iced::{system, Command, Element, Length};
pub fn main() -> iced::Result {
iced::application(
"System Information - Iced",
Example::update,
Example::view,
)
.run()
iced::program("System Information - Iced", Example::update, Example::view)
.run()
}
#[derive(Default)]

View file

@ -16,7 +16,7 @@ pub fn main() -> iced::Result {
#[cfg(not(target_arch = "wasm32"))]
tracing_subscriber::fmt::init();
iced::application(Tour::title, Tour::update, Tour::view)
iced::program(Tour::title, Tour::update, Tour::view)
.centered()
.run()
}

View file

@ -3,7 +3,7 @@ use iced::widget::{container, text};
use iced::{Element, Length, Subscription};
pub fn main() -> iced::Result {
iced::application("URL Handler - Iced", App::update, App::view)
iced::program("URL Handler - Iced", App::update, App::view)
.subscription(App::subscription)
.run()
}

View file

@ -6,7 +6,7 @@ use iced::widget::{
use iced::{Element, Length, Point, Rectangle, Renderer, Theme, Vector};
pub fn main() -> iced::Result {
iced::application(
iced::program(
"Vectorial Text - Iced",
VectorialText::update,
VectorialText::view,