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> {
|
||||
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> {
|
||||
iced::application(State::new, State::update, State::view)
|
||||
.subscription(State::subscription)
|
||||
.title(State::title)
|
||||
.theme(Theme::custom(
|
||||
"custom",
|
||||
theme::Palette {
|
||||
|
|
|
|||
Loading…
Reference in a new issue