SideBySide2: Show [ and ] shortcut keys in nav arrow tooltips

In the top right corner of a file the navigation cluster has a
tooltip on the up arrow but did not show the tooltip on the left
or right arrows. Show the key in the tooltip.

Change-Id: I192ef0ab8155c15b4bb35a18da33f74f15bb5537
This commit is contained in:
Shawn Pearce
2014-04-09 12:57:12 -07:00
committed by David Pursehouse
parent 9f821d2ba9
commit b4eb7ef652
3 changed files with 6 additions and 2 deletions

View File

@@ -178,11 +178,13 @@ class Header extends Composite {
return p.toString();
}
private void setupNav(InlineHyperlink link, int key, String help, FileInfo info) {
private void setupNav(InlineHyperlink link, char key, String help, FileInfo info) {
if (info != null) {
final String url = url(info);
link.setTargetHistoryToken(url);
link.setTitle(FileInfo.getFileName(info.path()));
link.setTitle(PatchUtil.M.fileNameWithShortcutKey(
FileInfo.getFileName(info.path()),
Character.toString(key)));
keys.add(new KeyCommand(0, key, help) {
@Override
public void onKeyPress(KeyPressEvent event) {

View File

@@ -23,4 +23,5 @@ public interface PatchMessages extends Messages {
String expandAfter(int cnt);
String draftSaved(Date when);
String patchSkipRegion(String lineNumber);
String fileNameWithShortcutKey(String file, String key);
}

View File

@@ -2,3 +2,4 @@ expandBefore = +{0}⇧
expandAfter = +{0}⇩
draftSaved = Draft saved at {0,time,short}
patchSkipRegion = ... skipped {0} common lines ...
fileNameWithShortcutKey = {0} (Shortcut: {1})