SideBySide2: Add "or [x] entire file" context option

Make it easier for users to get whole file context setting by
adding a checkbox next to the input field. When set the field
is cleared, so now users see:

  Context Lines   [    ] or [x] entire file

There are focus problems when the user modifies the lines of
context input text box and then clicks the "entire file" check mark
to show the entire file. The browser first delivers the change
event for the text box, and then delivers the click event on the
checkmark. Debounce these by delaying update of the view by 200
milliseconds, allowing the second click event to cancel the first
update and take priority, as this reflects the user intent.

When entire file is checked and the user enters a number into the
context box, immediately uncheck the entire file check box. When
focus is lost from the context box its new value will be committed
and the view will be updated.

Change-Id: Ic8f8f480df3ef39115c5322516ec149c1df8f89e
This commit is contained in:
Shawn Pearce
2013-12-05 11:29:29 -08:00
parent ce04c0994b
commit b5ee585d5a
2 changed files with 64 additions and 14 deletions

View File

@@ -41,8 +41,10 @@ limitations under the License.
-moz-border-radius: 10px;
}
.dialog .box { margin: 10px; }
.box { margin: 10px; }
.box .gwt-TextBox { padding: 0; }
.context { vertical-align: bottom; }
.table tr { min-height: 23px; }
.table th,
.table td {
@@ -160,9 +162,11 @@ limitations under the License.
</tr>
<tr>
<th><ui:msg>Lines of Context</ui:msg></th>
<td><x:NpIntTextBox ui:field='context'
<td><ui:msg><x:NpIntTextBox ui:field='context'
addStyleNames='{style.context}'
visibleLength='4'
alignment='RIGHT'/></td>
alignment='RIGHT'/>
or <g:CheckBox ui:field='contextEntireFile'>entire file</g:CheckBox></ui:msg></td>
</tr>
<tr>
<th><ui:msg>Intraline Difference</ui:msg></th>