ChangeScreen2: Click anywhere in path column to open file

Instead of requiring a precise click on the path name itself, accept
the entire path column as the click target.  This allows users to hit
a much larger area, which is easier on short file names like 'README'
or 'BUCK'.

Change-Id: I071c6394a33d08eba9b8ce252e92690106e8a743
This commit is contained in:
Shawn Pearce
2013-12-11 00:58:41 -08:00
parent d1451ead6b
commit fb227ea1c4

View File

@@ -81,6 +81,7 @@ class FileTable extends FlowPanel {
private static final String REVIEWED;
private static final String OPEN;
private static final int C_PATH = 3;
private static final HyperlinkImpl link = GWT.create(HyperlinkImpl.class);
static {
@@ -307,6 +308,15 @@ class FileTable extends FlowPanel {
Gerrit.display(url(list.get(row - 1)));
}
}
@Override
protected void onCellSingleClick(int row, int column) {
if (column == C_PATH) {
onOpenRow(row);
} else {
super.onCellSingleClick(row, column);
}
}
}
private final class DisplayCommand implements RepeatingCommand {