Highlight HEAD and refs/meta/config

In the ProjectBranchesScreen the entries for HEAD and refs/meta/config
are special since they do not represent ordinary branches but have a
special meaning. This is why they are already displayed at the top of
the table. With this change the rows for HEAD and refs/meta/config
will be printed with a special style to highlight them even more.

Change-Id: Id229f719ed7d5f1d06ad438371dee9b5470aa922
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2011-07-09 09:35:04 +02:00
parent 5eeac3cd97
commit 2b58c2a221
3 changed files with 30 additions and 4 deletions

View File

@@ -190,6 +190,8 @@ public interface GerritCss extends CssResource {
String skipLine();
String smallHeading();
String sourceFilePath();
String specialBranchDataCell();
String specialBranchIconCell();
String sshHostKeyPanel();
String sshHostKeyPanelFingerprintData();
String sshHostKeyPanelHeading();

View File

@@ -44,6 +44,8 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwtjsonrpc.client.RemoteJsonException;
import org.eclipse.jgit.lib.Constants;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -313,11 +315,19 @@ public class ProjectBranchesScreen extends ProjectScreen {
}
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
String iconCellStyle = Gerrit.RESOURCES.css().iconCell();
String dataCellStyle = Gerrit.RESOURCES.css().dataCell();
if ("refs/meta/config".equals(k.getShortName())
|| Constants.HEAD.equals(k.getShortName())) {
iconCellStyle = Gerrit.RESOURCES.css().specialBranchIconCell();
dataCellStyle = Gerrit.RESOURCES.css().specialBranchDataCell();
fmt.setStyleName(row, 0, iconCellStyle);
}
fmt.addStyleName(row, 1, iconCellStyle);
fmt.addStyleName(row, 2, dataCellStyle);
fmt.addStyleName(row, 3, dataCellStyle);
if (c != null) {
fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 4, dataCellStyle);
}
setRowItem(row, k);

View File

@@ -1363,3 +1363,17 @@ a:hover.downloadLink {
margin-right: 2px;
margin-bottom: 2px;
}
/** ProjectBranchesScreen **/
.specialBranchIconCell {
background: #ECECEC;
border-bottom: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
}
.specialBranchDataCell {
background: #ECECEC;
border: 1px solid white;
font-style: italic;
padding: 2px 6px 1px;
}