Make skip bar more user friendly

It is odd to put block expansion link only on number of skipped lines.
This change puts link on whole sentence "... skipped XX common lines
...".

Change-Id: I5c48a26fa7fa8758e35386994b80ef741e3ffa50
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
Dariusz Luksza
2014-03-25 14:30:55 +01:00
parent c06a36c1bf
commit 48c1f20ef7
5 changed files with 7 additions and 4 deletions

View File

@@ -97,11 +97,12 @@ class SkipBar extends Composite {
void setMarker(TextMarker marker, int length) {
this.marker = marker;
numSkipLines = length;
skipNum.setText(Integer.toString(length));
if (checkAndUpdateArrows()) {
upArrow.setHTML(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND));
downArrow.setHTML(PatchUtil.M.expandAfter(NUM_ROWS_TO_EXPAND));
}
skipNum.setText(PatchUtil.M.patchSkipRegion(Integer
.toString(length)));
}
static void link(SkipBar barA, SkipBar barB) {
@@ -111,7 +112,8 @@ class SkipBar extends Composite {
private void updateSkipNum() {
numSkipLines -= NUM_ROWS_TO_EXPAND;
skipNum.setText(String.valueOf(numSkipLines));
skipNum.setText(PatchUtil.M.patchSkipRegion(Integer
.toString(numSkipLines)));
checkAndUpdateArrows();
}

View File

@@ -44,9 +44,7 @@ limitations under the License.
<div class='{style.text}'>
<ui:msg>
<g:Anchor ui:field='upArrow' addStyleNames='{style.arrow} {style.anchor}' />
<span><ui:msg>... skipped </ui:msg></span>
<g:Anchor ui:field='skipNum' addStyleNames='{style.anchor}' />
<span><ui:msg> common lines ...</ui:msg></span>
<g:Anchor ui:field='downArrow' addStyleNames=' {style.arrow} {style.anchor}' />
</ui:msg>
</div>

View File

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

View File

@@ -1,3 +1,4 @@
expandBefore = +{0}&#x21e7;
expandAfter = +{0}&#x21e9;
draftSaved = Draft saved at {0,time,short}
patchSkipRegion = ... skipped {0} common lines ...

View File

@@ -1,2 +1,3 @@
expandBefore = +{0}&#x21e7;
expandAfter = +{0}&#x21e9;
patchSkipRegion = ... skipped {0} common lines ...