Fix: Border line is missing.
In Unified view the border line between the number columns is missing. This commit fixes this bug and shifts the line number column's width and align format. Change-Id: Ieb1019c4ee899338f0219480839b11ddf8b8aeab
This commit is contained in:
@@ -178,6 +178,7 @@ public interface GerritCss extends CssResource {
|
|||||||
String registerScreenNextLinks();
|
String registerScreenNextLinks();
|
||||||
String registerScreenSection();
|
String registerScreenSection();
|
||||||
String rightmost();
|
String rightmost();
|
||||||
|
String rightBorder();
|
||||||
String rpcStatus();
|
String rpcStatus();
|
||||||
String rpcStatusLoading();
|
String rpcStatusLoading();
|
||||||
String rpcStatusPanel();
|
String rpcStatusPanel();
|
||||||
|
|||||||
@@ -682,8 +682,8 @@
|
|||||||
.lineNumber {
|
.lineNumber {
|
||||||
padding-left: 0.2em;
|
padding-left: 0.2em;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
width: 3.5em;
|
width: 1.5em;
|
||||||
text-align: right;
|
text-align: center;
|
||||||
padding-right: 0.2em;
|
padding-right: 0.2em;
|
||||||
background: white;
|
background: white;
|
||||||
border-bottom: 1px solid white;
|
border-bottom: 1px solid white;
|
||||||
@@ -691,6 +691,9 @@
|
|||||||
.lineNumber.rightmost {
|
.lineNumber.rightmost {
|
||||||
border-left: thin solid #b0bdcc;
|
border-left: thin solid #b0bdcc;
|
||||||
}
|
}
|
||||||
|
.lineNumber.rightBorder {
|
||||||
|
border-right: thin solid #b0bdcc;
|
||||||
|
}
|
||||||
.lineNumber a {
|
.lineNumber a {
|
||||||
color: #888;
|
color: #888;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
while (hunk.next()) {
|
while (hunk.next()) {
|
||||||
if (hunk.isContextLine()) {
|
if (hunk.isContextLine()) {
|
||||||
openLine(nc);
|
openLine(nc);
|
||||||
appendLineNumber(nc, hunk.getCurA());
|
appendLineNumberForSideA(nc, hunk.getCurA());
|
||||||
appendLineNumber(nc, hunk.getCurB());
|
appendLineNumberForSideB(nc, hunk.getCurB());
|
||||||
appendLineText(nc, false, CONTEXT, a, hunk.getCurA());
|
appendLineText(nc, false, CONTEXT, a, hunk.getCurA());
|
||||||
closeLine(nc);
|
closeLine(nc);
|
||||||
hunk.incBoth();
|
hunk.incBoth();
|
||||||
@@ -158,8 +158,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
|
|
||||||
} else if (hunk.isDeletedA()) {
|
} else if (hunk.isDeletedA()) {
|
||||||
openLine(nc);
|
openLine(nc);
|
||||||
appendLineNumber(nc, hunk.getCurA());
|
appendLineNumberForSideA(nc, hunk.getCurA());
|
||||||
padLineNumber(nc);
|
padLineNumberForSideB(nc);
|
||||||
appendLineText(nc, syntaxHighlighting, DELETE, a, hunk.getCurA());
|
appendLineText(nc, syntaxHighlighting, DELETE, a, hunk.getCurA());
|
||||||
closeLine(nc);
|
closeLine(nc);
|
||||||
hunk.incA();
|
hunk.incA();
|
||||||
@@ -171,8 +171,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
|
|
||||||
} else if (hunk.isInsertedB()) {
|
} else if (hunk.isInsertedB()) {
|
||||||
openLine(nc);
|
openLine(nc);
|
||||||
padLineNumber(nc);
|
padLineNumberForSideA(nc);
|
||||||
appendLineNumber(nc, hunk.getCurB());
|
appendLineNumberForSideB(nc, hunk.getCurB());
|
||||||
appendLineText(nc, syntaxHighlighting, INSERT, b, hunk.getCurB());
|
appendLineText(nc, syntaxHighlighting, INSERT, b, hunk.getCurB());
|
||||||
closeLine(nc);
|
closeLine(nc);
|
||||||
hunk.incB();
|
hunk.incB();
|
||||||
@@ -253,6 +253,7 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
super.insertRow(row);
|
super.insertRow(row);
|
||||||
final CellFormatter fmt = table.getCellFormatter();
|
final CellFormatter fmt = table.getCellFormatter();
|
||||||
fmt.addStyleName(row, PC - 2, Gerrit.RESOURCES.css().lineNumber());
|
fmt.addStyleName(row, PC - 2, Gerrit.RESOURCES.css().lineNumber());
|
||||||
|
fmt.addStyleName(row, PC - 2, Gerrit.RESOURCES.css().rightBorder());
|
||||||
fmt.addStyleName(row, PC - 1, Gerrit.RESOURCES.css().lineNumber());
|
fmt.addStyleName(row, PC - 1, Gerrit.RESOURCES.css().lineNumber());
|
||||||
fmt.addStyleName(row, PC, Gerrit.RESOURCES.css().diffText());
|
fmt.addStyleName(row, PC, Gerrit.RESOURCES.css().diffText());
|
||||||
}
|
}
|
||||||
@@ -269,8 +270,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
|
|
||||||
private void appendFileHeader(final SafeHtmlBuilder m, final String line) {
|
private void appendFileHeader(final SafeHtmlBuilder m, final String line) {
|
||||||
openLine(m);
|
openLine(m);
|
||||||
padLineNumber(m);
|
padLineNumberForSideA(m);
|
||||||
padLineNumber(m);
|
padLineNumberForSideB(m);
|
||||||
|
|
||||||
m.openTd();
|
m.openTd();
|
||||||
m.addStyleName(Gerrit.RESOURCES.css().diffText());
|
m.addStyleName(Gerrit.RESOURCES.css().diffText());
|
||||||
@@ -282,8 +283,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
|
|
||||||
private void appendHunkHeader(final SafeHtmlBuilder m, final Hunk hunk) {
|
private void appendHunkHeader(final SafeHtmlBuilder m, final Hunk hunk) {
|
||||||
openLine(m);
|
openLine(m);
|
||||||
padLineNumber(m);
|
padLineNumberForSideA(m);
|
||||||
padLineNumber(m);
|
padLineNumberForSideB(m);
|
||||||
|
|
||||||
m.openTd();
|
m.openTd();
|
||||||
m.addStyleName(Gerrit.RESOURCES.css().diffText());
|
m.addStyleName(Gerrit.RESOURCES.css().diffText());
|
||||||
@@ -352,8 +353,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
|
|
||||||
private void appendNoLF(final SafeHtmlBuilder m) {
|
private void appendNoLF(final SafeHtmlBuilder m) {
|
||||||
openLine(m);
|
openLine(m);
|
||||||
padLineNumber(m);
|
padLineNumberForSideA(m);
|
||||||
padLineNumber(m);
|
padLineNumberForSideB(m);
|
||||||
m.openTd();
|
m.openTd();
|
||||||
m.addStyleName(Gerrit.RESOURCES.css().diffText());
|
m.addStyleName(Gerrit.RESOURCES.css().diffText());
|
||||||
m.addStyleName(Gerrit.RESOURCES.css().diffTextNoLF());
|
m.addStyleName(Gerrit.RESOURCES.css().diffTextNoLF());
|
||||||
@@ -374,16 +375,31 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
m.closeTr();
|
m.closeTr();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void padLineNumber(final SafeHtmlBuilder m) {
|
private void padLineNumberForSideB(final SafeHtmlBuilder m) {
|
||||||
m.openTd();
|
m.openTd();
|
||||||
m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
|
m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
|
||||||
m.closeTd();
|
m.closeTd();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appendLineNumber(final SafeHtmlBuilder m, final int idx) {
|
private void padLineNumberForSideA(final SafeHtmlBuilder m) {
|
||||||
|
m.openTd();
|
||||||
|
m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
|
||||||
|
m.addStyleName(Gerrit.RESOURCES.css().rightBorder());
|
||||||
|
m.closeTd();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void appendLineNumberForSideB(final SafeHtmlBuilder m, final int idx) {
|
||||||
m.openTd();
|
m.openTd();
|
||||||
m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
|
m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
|
||||||
m.append(SafeHtml.asis("<a href=\"javascript:void(0)\">"+ (idx + 1) + "</a>"));
|
m.append(SafeHtml.asis("<a href=\"javascript:void(0)\">"+ (idx + 1) + "</a>"));
|
||||||
m.closeTd();
|
m.closeTd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void appendLineNumberForSideA(final SafeHtmlBuilder m, final int idx) {
|
||||||
|
m.openTd();
|
||||||
|
m.setStyleName(Gerrit.RESOURCES.css().lineNumber());
|
||||||
|
m.addStyleName(Gerrit.RESOURCES.css().rightBorder());
|
||||||
|
m.append(SafeHtml.asis("<a href=\"javascript:void(0)\">"+ (idx + 1) + "</a>"));
|
||||||
|
m.closeTd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user