提交 3931568f 编写于 作者: M mindless

[HUDSON-2922] Rather than center first 2 columns ("S" and "W"),

use nbsp to indent based on current iconSize (1 nbsp per 10px of iconSize).
Sortable table alters th content, so was unable to use css to indent here.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15054 71c3de6d-444a-0410-be80-ed276b4c234a
上级 90b51314
......@@ -427,6 +427,19 @@ public class Functions {
else return n+' ';
}
/**
* One nbsp per 10 pixels in given size, which may be a plain number or "NxN"
* (like an iconSize). Useful in a sortable table heading.
*/
public static String nbspIndent(String size) {
int i = size.indexOf('x');
i = Integer.parseInt(i > 0 ? size.substring(0, i) : size) / 10;
StringBuilder buf = new StringBuilder(30);
for (int j = 0; j < i; j++)
buf.append("&nbsp;");
return buf.toString();
}
public static String getWin32ErrorMessage(IOException e) {
return Util.getWin32ErrorMessage(e);
}
......
......@@ -22,8 +22,8 @@
style="${h.ifThenElse(showViewTabs!=null,'margin-top:0px; border-top: none;',null)}">
<tr style="border-top: 0px;">
<th class="ctr" tooltip="${%Status of the last build}">S</th>
<th class="ctr" tooltip="${%Weather report showing aggregated status of recent builds}">W</th>
<th tooltip="${%Status of the last build}">${h.nbspIndent(iconSize)}S</th>
<th tooltip="${%Weather report showing aggregated status of recent builds}">${h.nbspIndent(iconSize)}W</th>
<th initialSortDir="down">${%Job}</th>
<j:forEach var="col" items="${columnExtensions}">
<th>${col.columnCaption}</th>
......
......@@ -461,9 +461,6 @@ th.pane {
white-space: nowrap;
}
#projectstatus th.ctr {
text-align: center;
}
#projectstatus th {
text-align: left;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册