Rename timer example to stopwatch
This commit is contained in:
parent
f0381a7fb3
commit
69ed631d44
1 changed files with 6 additions and 6 deletions
|
|
@ -6,10 +6,10 @@ use iced::{
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
Timer::run(Settings::default())
|
Stopwatch::run(Settings::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Timer {
|
struct Stopwatch {
|
||||||
duration: Duration,
|
duration: Duration,
|
||||||
state: State,
|
state: State,
|
||||||
toggle: button::State,
|
toggle: button::State,
|
||||||
|
|
@ -28,12 +28,12 @@ enum Message {
|
||||||
Tick(Instant),
|
Tick(Instant),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Application for Timer {
|
impl Application for Stopwatch {
|
||||||
type Message = Message;
|
type Message = Message;
|
||||||
|
|
||||||
fn new() -> (Timer, Command<Message>) {
|
fn new() -> (Stopwatch, Command<Message>) {
|
||||||
(
|
(
|
||||||
Timer {
|
Stopwatch {
|
||||||
duration: Duration::default(),
|
duration: Duration::default(),
|
||||||
state: State::Idle,
|
state: State::Idle,
|
||||||
toggle: button::State::new(),
|
toggle: button::State::new(),
|
||||||
|
|
@ -44,7 +44,7 @@ impl Application for Timer {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn title(&self) -> String {
|
fn title(&self) -> String {
|
||||||
String::from("Timer - Iced")
|
String::from("Stopwatch - Iced")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, message: Message) -> Command<Message> {
|
fn update(&mut self, message: Message) -> Command<Message> {
|
||||||
Loading…
Add table
Add a link
Reference in a new issue