Apply the size title to the entire cell

When a change is very small (e.g.  5 lines) the size bar is so few
pixels it is nearly impossible to hover over it and see the tooltip.
Apply the title to the entire table cell, giving the user a much
larger target to hover on.

Change-Id: I6ce8ab3a2e55279a9d6345aced42f8c179c608cf
This commit is contained in:
Shawn Pearce
2013-12-05 17:11:27 -08:00
parent 5944ac6643
commit c53b447e16

View File

@@ -192,6 +192,7 @@ public class ChangeTable2 extends NavigationTable<ChangeInfo> {
private void populateChangeRow(final int row, final ChangeInfo c,
boolean highlightUnreviewed) {
CellFormatter fmt = table.getCellFormatter();
if (Gerrit.isSignedIn()) {
table.setWidget(row, C_STAR, StarredChanges.createIcon(
c.legacy_id(),
@@ -227,11 +228,12 @@ public class ChangeTable2 extends NavigationTable<ChangeInfo> {
table.setText(row, C_LAST_UPDATE, shortFormat(c.updated()));
}
table.setWidget(row, C_SIZE, getSizeWidget(c));
fmt.getElement(row, C_SIZE).setTitle(
Util.M.insertionsAndDeletions(c.insertions(), c.deletions()));
boolean displayName = Gerrit.isSignedIn() && Gerrit.getUserAccount()
.getGeneralPreferences().isShowUsernameInReviewCategory();
CellFormatter fmt = table.getCellFormatter();
for (int idx = 0; idx < labelNames.size(); idx++) {
String name = labelNames.get(idx);
int col = BASE_COLUMNS + idx;
@@ -321,7 +323,6 @@ public class ChangeTable2 extends NavigationTable<ChangeInfo> {
panel.setStyleName(Gerrit.RESOURCES.css().changeSize());
panel.setWidth(width + "px");
panel.getElement().getStyle().setBackgroundColor(bg);
panel.setTitle(Util.M.insertionsAndDeletions(c.insertions(), c.deletions()));
return panel;
}