1
0
mirror of https://github.com/pcvolkmer/cert-tools.git synced 2025-04-19 17:06:49 +00:00

refactor: use icon::from_file_data()

This commit is contained in:
Paul-Christian Volkmer 2025-01-24 16:30:52 +01:00
parent 75455843ee
commit 582bc7d36e
2 changed files with 1 additions and 6 deletions

View File

@ -8,7 +8,6 @@ cert-tools = { path = "..", version = "*" }
iced = { version = "0.13", features = ["wgpu", "tiny-skia", "tokio", "web-colors", "image"], default-features = false } iced = { version = "0.13", features = ["wgpu", "tiny-skia", "tokio", "web-colors", "image"], default-features = false }
rfd = "0.15" rfd = "0.15"
itertools = "0.14" itertools = "0.14"
image = {version = "0.25", features = ["ico"], default-features = false }
[build-dependencies] [build-dependencies]
winresource = "0.1" winresource = "0.1"

View File

@ -26,7 +26,6 @@ use iced::widget::{
self, button, column, container, horizontal_rule, horizontal_space, row, text, text_editor, self, button, column, container, horizontal_rule, horizontal_space, row, text, text_editor,
text_input, Container, Scrollable, text_input, Container, Scrollable,
}; };
use iced::window::icon;
use iced::{ use iced::{
alignment, application, clipboard, color, window, Background, Border, Color, Element, Font, alignment, application, clipboard, color, window, Background, Border, Color, Element, Font,
Length, Pixels, Settings, Size, Task, Length, Pixels, Settings, Size, Task,
@ -42,10 +41,7 @@ fn main() -> iced::Result {
..Settings::default() ..Settings::default()
}) })
.window(window::Settings { .window(window::Settings {
icon: match image::load_from_memory(include_bytes!("../../resources/icon.ico")) { icon: window::icon::from_file_data(include_bytes!("../../resources/icon.ico"), None).ok(),
Ok(image) => icon::from_rgba(image.as_bytes().to_vec(), 128, 128).ok(),
_ => None,
},
..window::Settings::default() ..window::Settings::default()
}) })
.resizable(false) .resizable(false)