fix!(windows): remove desktop dependency for the about feature
BREAKING CHANGE: Icon must be provided as a handle instead of a string.
This commit is contained in:
parent
2099dc45cb
commit
5e136f9499
2 changed files with 3 additions and 7 deletions
|
|
@ -12,7 +12,7 @@ default = ["multi-window", "a11y"]
|
||||||
# Accessibility support
|
# Accessibility support
|
||||||
a11y = ["iced/a11y", "iced_accessibility"]
|
a11y = ["iced/a11y", "iced_accessibility"]
|
||||||
# Enable about widget
|
# Enable about widget
|
||||||
about = ["desktop", "dep:license"]
|
about = ["dep:license"]
|
||||||
# Builds support for animated images
|
# Builds support for animated images
|
||||||
animated-image = ["dep:async-fs", "image/gif", "tokio?/io-util", "tokio?/fs"]
|
animated-image = ["dep:async-fs", "image/gif", "tokio?/io-util", "tokio?/fs"]
|
||||||
# XXX autosize should not be used on winit windows unless dialogs
|
# XXX autosize should not be used on winit windows unless dialogs
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
Element,
|
Element,
|
||||||
desktop::{IconSourceExt, fde},
|
|
||||||
iced::{Alignment, Length},
|
iced::{Alignment, Length},
|
||||||
widget::{self, horizontal_space},
|
widget::{self, horizontal_space},
|
||||||
},
|
},
|
||||||
|
|
@ -15,7 +14,7 @@ pub struct About {
|
||||||
/// The application's name.
|
/// The application's name.
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
/// The application's icon name.
|
/// The application's icon name.
|
||||||
icon: Option<String>,
|
icon: Option<widget::icon::Handle>,
|
||||||
/// The application's version.
|
/// The application's version.
|
||||||
version: Option<String>,
|
version: Option<String>,
|
||||||
/// Name of the application's author.
|
/// Name of the application's author.
|
||||||
|
|
@ -138,10 +137,7 @@ pub fn about<'a, Message: Clone + 'static>(
|
||||||
};
|
};
|
||||||
|
|
||||||
let application_name = about.name.as_ref().map(widget::text::title3);
|
let application_name = about.name.as_ref().map(widget::text::title3);
|
||||||
let application_icon = about
|
let application_icon = about.icon.as_ref().map(|i| i.clone().icon());
|
||||||
.icon
|
|
||||||
.as_ref()
|
|
||||||
.map(|icon| fde::IconSource::Name(icon.clone()).as_cosmic_icon());
|
|
||||||
let author = about.author.as_ref().map(widget::text::body);
|
let author = about.author.as_ref().map(widget::text::body);
|
||||||
let version = about.version.as_ref().map(widget::button::standard);
|
let version = about.version.as_ref().map(widget::button::standard);
|
||||||
let links_section = section(&about.links, "Links");
|
let links_section = section(&about.links, "Links");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue