feat: display image dimensions in title
This commit is contained in:
parent
e32c18e304
commit
c4738ad2c8
1 changed files with 7 additions and 0 deletions
|
|
@ -170,11 +170,18 @@ impl State {
|
||||||
fn subscription(&self) -> Subscription<Message> {
|
fn subscription(&self) -> Subscription<Message> {
|
||||||
event::listen().map(Message::Event)
|
event::listen().map(Message::Event)
|
||||||
}
|
}
|
||||||
|
fn title(&self) -> String {
|
||||||
|
match self.image.as_ref() {
|
||||||
|
Some(image) => format!("imagey {}x{}", image.width(), image.height()),
|
||||||
|
None => format!("imagey"),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), iced::Error> {
|
fn main() -> Result<(), iced::Error> {
|
||||||
iced::application(State::new, State::update, State::view)
|
iced::application(State::new, State::update, State::view)
|
||||||
.subscription(State::subscription)
|
.subscription(State::subscription)
|
||||||
|
.title(State::title)
|
||||||
.theme(Theme::custom(
|
.theme(Theme::custom(
|
||||||
"custom",
|
"custom",
|
||||||
theme::Palette {
|
theme::Palette {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue