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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
expandBefore = +{0}⇧
|
||||
expandAfter = +{0}⇩
|
||||
draftSaved = Draft saved at {0,time,short}
|
||||
patchSkipRegion = ... skipped {0} common lines ...
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
expandBefore = +{0}⇧
|
||||
expandAfter = +{0}⇩
|
||||
patchSkipRegion = ... skipped {0} common lines ...
|
||||
|
||||
Reference in New Issue
Block a user