mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add alt-d shortcut to select address bar text (#37794)
I usually use the alt-d in shortcut in Firefox to select the text in the address bar. Firefox supports both alt-d and ctrl-l. This change adds the alt-d shortcut so you can use either. Testing: I tested it by running Servo and pressing alt-d. I don't know if there is a way to create a test for it? --------- Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
This commit is contained in:
parent
a13f9bce62
commit
b8ac9d3472
1 changed files with 7 additions and 1 deletions
|
@ -331,8 +331,14 @@ impl Minibrowser {
|
|||
if location_field.changed() {
|
||||
location_dirty.set(true);
|
||||
}
|
||||
// Handle adddress bar shortcut.
|
||||
if ui.input(|i| {
|
||||
i.clone().consume_key(Modifiers::COMMAND, Key::L)
|
||||
if cfg!(target_os = "macos") {
|
||||
i.clone().consume_key(Modifiers::COMMAND, Key::L)
|
||||
} else {
|
||||
i.clone().consume_key(Modifiers::COMMAND, Key::L) ||
|
||||
i.clone().consume_key(Modifiers::ALT, Key::D)
|
||||
}
|
||||
}) {
|
||||
location_field.request_focus();
|
||||
if let Some(mut state) =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue