SideBySide2: Display red bar in line number gutter at padding

Instead of the bare gutter where padding widgets are inserted, display
a red bar in the line number gutter so the reader can visually follow
that this side of the file is the prior line number connected to the
next line number, and isn't just a rendering glitch.

Change-Id: I9792fb6a93a15c25f5bd31da2f478c2c28ab8f48
This commit is contained in:
Shawn Pearce
2013-12-11 00:35:10 -08:00
parent d1451ead6b
commit 3e4b11b8db
3 changed files with 6 additions and 0 deletions

View File

@@ -45,6 +45,7 @@ class DiffTable extends Composite {
String range();
String rangeHighlight();
String showTabs();
String padding();
}
@UiField

View File

@@ -109,6 +109,10 @@ limitations under the License.
content: "\00bb";
color: #f00;
}
.padding {
margin-left: 21px;
border-left: 2px solid #d64040;
}
</ui:style>
<g:HTMLPanel styleName='{style.difftable}'>
<table class='{style.table}'>

View File

@@ -1146,6 +1146,7 @@ public class SideBySide2 extends Screen {
private PaddingWidgetWrapper addPaddingWidget(CodeMirror cm,
int line, double height, Unit unit, Integer index) {
SimplePanel padding = new SimplePanel();
padding.setStyleName(DiffTable.style.padding());
padding.getElement().getStyle().setHeight(height, unit);
Configuration config = Configuration.create()
.set("coverGutter", true)