From 561b348c793a5a515757db5c25176b08db881adb Mon Sep 17 00:00:00 2001
From: Puck Meerburg <puck@puckipedia.nl>
Date: Tue, 19 Nov 2013 22:22:42 +0000
Subject: [PATCH] Added shortcut for location bar
---
src/kits/tracker/ContainerWindow.cpp | 4 ++++
src/kits/tracker/Navigator.cpp | 11 +++++++++++
src/kits/tracker/Navigator.h | 4 +++-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp
index 294bca4..221b791 100644
a
|
b
|
BContainerWindow::SetSingleWindowBrowseShortcuts(bool enabled)
|
4056 | 4056 | new BMessage(kNavigatorCommandUp), Navigator()); |
4057 | 4057 | AddShortcut(B_DOWN_ARROW, B_OPTION_KEY | B_COMMAND_KEY, |
4058 | 4058 | new BMessage(kOpenSelection), PoseView()); |
| 4059 | AddShortcut('L', B_COMMAND_KEY, |
| 4060 | new BMessage(kNavigatorCommandFocusLocation), Navigator()); |
4059 | 4061 | |
4060 | 4062 | } else { |
| 4063 | RemoveShortcut('L', B_COMMAND_KEY); |
| 4064 | |
4061 | 4065 | RemoveShortcut(B_LEFT_ARROW, B_COMMAND_KEY); |
4062 | 4066 | RemoveShortcut(B_RIGHT_ARROW, B_COMMAND_KEY); |
4063 | 4067 | RemoveShortcut(B_UP_ARROW, B_COMMAND_KEY); |
diff --git a/src/kits/tracker/Navigator.cpp b/src/kits/tracker/Navigator.cpp
index 3d0ef5c..74df099 100644
a
|
b
|
BNavigator::MessageReceived(BMessage* message)
|
234 | 234 | GoTo(); |
235 | 235 | break; |
236 | 236 | |
| 237 | case kNavigatorCommandFocusLocation: |
| 238 | FocusLocation(); |
| 239 | break; |
| 240 | |
237 | 241 | default: |
238 | 242 | { |
239 | 243 | // Catch any dropped refs and try to switch to this new directory |
… |
… |
BNavigator::MessageReceived(BMessage* message)
|
257 | 261 | |
258 | 262 | |
259 | 263 | void |
| 264 | BNavigator::FocusLocation() |
| 265 | { |
| 266 | fLocation->MakeFocus(); |
| 267 | } |
| 268 | |
| 269 | |
| 270 | void |
260 | 271 | BNavigator::GoBackward(bool option) |
261 | 272 | { |
262 | 273 | int32 itemCount = fBackHistory.CountItems(); |
diff --git a/src/kits/tracker/Navigator.h b/src/kits/tracker/Navigator.h
index d290a2f..19e7eea 100644
a
|
b
|
enum NavigationAction
|
58 | 58 | kNavigatorCommandBackward = 'NVBW', |
59 | 59 | kNavigatorCommandForward = 'NVFW', |
60 | 60 | kNavigatorCommandUp = 'NVUP', |
61 | | kNavigatorCommandLocation = 'NVLC' |
| 61 | kNavigatorCommandLocation = 'NVLC', |
| 62 | kNavigatorCommandFocusLocation = 'NVFL' |
62 | 63 | }; |
63 | 64 | |
64 | 65 | |
… |
… |
protected:
|
104 | 105 | void GoBackward(bool option); |
105 | 106 | void GoUp(bool option); |
106 | 107 | void SendNavigationMessage(NavigationAction, BEntry*, bool option); |
| 108 | void FocusLocation(); |
107 | 109 | |
108 | 110 | void GoTo(); |
109 | 111 | |