mirror of
https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation.git
synced 2026-08-28 10:18:09 +02:00
Simplify keyboard shortcut code
Ran cargo fmt as well
This commit is contained in:
parent
9f4327aa4b
commit
424ddeb522
1 changed files with 12 additions and 15 deletions
|
|
@ -100,22 +100,19 @@ impl UadGui {
|
|||
|
||||
fn subscription(&self) -> Subscription<Message> {
|
||||
event::listen_with(|event, _status, _env| match event {
|
||||
iced::Event::Keyboard(keyboard::Event::KeyPressed { key, modifiers, .. }) => {
|
||||
if modifiers.control() && modifiers.shift() {
|
||||
match key {
|
||||
keyboard::Key::Character(c) if c == "r" => {
|
||||
Some(Message::RebootButtonPressed)
|
||||
}
|
||||
keyboard::Key::Character(c) if c == "5" => {
|
||||
Some(Message::RefreshButtonPressed)
|
||||
}
|
||||
keyboard::Key::Character(c) if c == "a" => Some(Message::AppsPress),
|
||||
keyboard::Key::Character(c) if c == "i" => Some(Message::AboutPressed),
|
||||
keyboard::Key::Character(c) if c == "s" => Some(Message::SettingsPressed),
|
||||
iced::Event::Keyboard(keyboard::Event::KeyPressed { key, modifiers, .. })
|
||||
if modifiers.control() && modifiers.shift() =>
|
||||
{
|
||||
match key {
|
||||
keyboard::Key::Character(c) => match c.as_str() {
|
||||
"r" => Some(Message::RebootButtonPressed),
|
||||
"5" => Some(Message::RefreshButtonPressed),
|
||||
"a" => Some(Message::AppsPress),
|
||||
"i" => Some(Message::AboutPressed),
|
||||
"s" => Some(Message::SettingsPressed),
|
||||
_ => None,
|
||||
}
|
||||
} else {
|
||||
None
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue