refactor: update dependencies and improve keyboard event handling in KLauncherApp

This commit is contained in:
2026-03-15 16:37:46 +01:00
parent 6780444caa
commit c059961854
3 changed files with 8 additions and 98 deletions

94
Cargo.lock generated
View File

@@ -1043,12 +1043,6 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
[[package]]
name = "float_next_after"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8"
[[package]] [[package]]
name = "foldhash" name = "foldhash"
version = "0.1.5" version = "0.1.5"
@@ -1518,7 +1512,6 @@ dependencies = [
"image", "image",
"kamadak-exif", "kamadak-exif",
"log", "log",
"lyon_path",
"raw-window-handle", "raw-window-handle",
"rustc-hash 2.1.1", "rustc-hash 2.1.1",
"thiserror 2.0.18", "thiserror 2.0.18",
@@ -1594,7 +1587,6 @@ dependencies = [
"iced_debug", "iced_debug",
"iced_graphics", "iced_graphics",
"log", "log",
"lyon",
"resvg", "resvg",
"rustc-hash 2.1.1", "rustc-hash 2.1.1",
"thiserror 2.0.18", "thiserror 2.0.18",
@@ -1967,58 +1959,6 @@ version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593" checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593"
[[package]]
name = "lyon"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd0578bdecb7d6d88987b8b2b1e3a4e2f81df9d0ece1078623324a567904e7b7"
dependencies = [
"lyon_algorithms",
"lyon_tessellation",
]
[[package]]
name = "lyon_algorithms"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9815fac08e6fd96733a11dce4f9d15a3f338e96a2e2311ee21e1b738efc2bc0f"
dependencies = [
"lyon_path",
"num-traits",
]
[[package]]
name = "lyon_geom"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4336502e29e32af93cf2dad2214ed6003c17ceb5bd499df77b1de663b9042b92"
dependencies = [
"arrayvec",
"euclid",
"num-traits",
]
[[package]]
name = "lyon_path"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c463f9c428b7fc5ec885dcd39ce4aa61e29111d0e33483f6f98c74e89d8621e"
dependencies = [
"lyon_geom",
"num-traits",
]
[[package]]
name = "lyon_tessellation"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05a35a7dd71b845ff317ce1834c4185506b79790294bde397df8d5c23031e357"
dependencies = [
"float_next_after",
"lyon_path",
"num-traits",
]
[[package]] [[package]]
name = "malloc_buf" name = "malloc_buf"
version = "0.0.6" version = "0.0.6"
@@ -2087,17 +2027,6 @@ dependencies = [
"simd-adler32", "simd-adler32",
] ]
[[package]]
name = "mio"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
dependencies = [
"libc",
"wasi",
"windows-sys 0.61.2",
]
[[package]] [[package]]
name = "moxcms" name = "moxcms"
version = "0.7.11" version = "0.7.11"
@@ -3500,16 +3429,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "socket2"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e"
dependencies = [
"libc",
"windows-sys 0.61.2",
]
[[package]] [[package]]
name = "softbuffer" name = "softbuffer"
version = "0.4.8" version = "0.4.8"
@@ -3754,15 +3673,8 @@ version = "1.50.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d"
dependencies = [ dependencies = [
"bytes",
"libc",
"mio",
"parking_lot",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry",
"socket2",
"tokio-macros", "tokio-macros",
"windows-sys 0.61.2",
] ]
[[package]] [[package]]
@@ -3989,12 +3901,6 @@ dependencies = [
"winapi-util", "winapi-util",
] ]
[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]] [[package]]
name = "wasip2" name = "wasip2"
version = "1.0.2+wasi-0.2.9" version = "1.0.2+wasi-0.2.9"

View File

@@ -13,7 +13,7 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
async-trait = "0.1" async-trait = "0.1"
futures = "0.3" futures = "0.3"
iced = { version = "0.14", features = ["canvas", "image", "svg", "tokio", "wgpu"] } iced = { version = "0.14", features = ["image", "svg", "tokio", "tiny-skia"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.35", features = ["full"] } tokio = { version = "1.35", features = ["rt-multi-thread", "macros"] }
tracing = "0.1" tracing = "0.1"

View File

@@ -2,7 +2,8 @@ use std::sync::Arc;
use iced::{ use iced::{
Color, Element, Length, Size, Subscription, Task, Color, Element, Length, Size, Subscription, Task,
keyboard::{self, Event as KeyEvent, Key, key::Named}, event,
keyboard::{Event as KeyEvent, Key, key::Named},
widget::{column, container, image, row, scrollable, svg, text, text_input, Space}, widget::{column, container, image, row, scrollable, svg, text, text_input, Space},
window, window,
}; };
@@ -152,7 +153,10 @@ fn view(state: &KLauncherApp) -> Element<'_, Message> {
} }
fn subscription(_state: &KLauncherApp) -> Subscription<Message> { fn subscription(_state: &KLauncherApp) -> Subscription<Message> {
keyboard::listen().map(Message::KeyPressed) event::listen_with(|ev, _status, _id| match ev {
iced::Event::Keyboard(ke) => Some(Message::KeyPressed(ke)),
_ => None,
})
} }
pub fn run(kernel: Arc<Kernel>) -> iced::Result { pub fn run(kernel: Arc<Kernel>) -> iced::Result {