Do not clone Key
This commit is contained in:
parent
2688dd0d88
commit
ae2d49d711
3 changed files with 19 additions and 19 deletions
32
Cargo.lock
generated
32
Cargo.lock
generated
|
|
@ -1086,7 +1086,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"cosmic-config-derive",
|
||||
|
|
@ -1103,7 +1103,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -1174,7 +1174,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"almost",
|
||||
"cosmic-config",
|
||||
|
|
@ -2680,7 +2680,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"iced_accessibility",
|
||||
"iced_core",
|
||||
|
|
@ -2695,7 +2695,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_accessibility"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"accesskit_winit",
|
||||
|
|
@ -2704,7 +2704,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"log",
|
||||
|
|
@ -2721,7 +2721,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -2734,7 +2734,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2758,7 +2758,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -2770,7 +2770,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"iced_futures",
|
||||
|
|
@ -2780,7 +2780,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_style"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"once_cell",
|
||||
|
|
@ -2790,7 +2790,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -2807,7 +2807,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2826,7 +2826,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"iced_renderer",
|
||||
"iced_runtime",
|
||||
|
|
@ -2840,7 +2840,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_winit"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_runtime",
|
||||
|
|
@ -3191,7 +3191,7 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#d0ff0b739da40622d2c0fc023f81dd61c1be4e5b"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b01b34df2bc54e13f59cf91e9137ecef978d1c26"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"ashpd",
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ pub struct KeyBind {
|
|||
}
|
||||
|
||||
impl KeyBind {
|
||||
pub fn matches(&self, modifiers: Modifiers, key: Key) -> bool {
|
||||
self.key == key
|
||||
pub fn matches(&self, modifiers: Modifiers, key: &Key) -> bool {
|
||||
key == &self.key
|
||||
&& modifiers.logo() == self.modifiers.contains(&Modifier::Super)
|
||||
&& modifiers.control() == self.modifiers.contains(&Modifier::Ctrl)
|
||||
&& modifiers.alt() == self.modifiers.contains(&Modifier::Alt)
|
||||
|
|
|
|||
|
|
@ -1391,7 +1391,7 @@ impl Application for App {
|
|||
}
|
||||
Message::Key(modifiers, key) => {
|
||||
for (key_bind, action) in self.key_binds.iter() {
|
||||
if key_bind.matches(modifiers, key.clone()) {
|
||||
if key_bind.matches(modifiers, &key) {
|
||||
return self.update(action.message());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue