]> source.dussan.org Git - gitblit.git/commitdiff
Change diffstat character to improve look and layout
authorJames Moger <james.moger@gitblit.com>
Mon, 30 Sep 2013 11:59:42 +0000 (07:59 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 30 Sep 2013 14:10:36 +0000 (10:10 -0400)
Change-Id: I7a70b04e9b8e49a78d98e0842aeda3f6d8e3ce28

src/main/java/com/gitblit/wicket/panels/DiffStatPanel.java

index e1f0af92242ac3c4061684d78996fd84708a8109..30a89027e8b581902b31559c06a856cf33b14b9c 100644 (file)
@@ -26,7 +26,7 @@ import com.gitblit.wicket.WicketUtils;
 \r
 /**\r
  * Display a diffstat.\r
- * \r
+ *\r
  * @author James Moger\r
  *\r
  */\r
@@ -62,12 +62,18 @@ public class DiffStatPanel extends Panel {
                WicketUtils.setHtmlTooltip(this, diffStat);\r
 \r
                final NormalizedDiffStat n = DiffUtils.normalizeDiffStat(5, insertions, deletions);\r
-               \r
-               final String square = "&#9632;";\r
+\r
+               final String segment;\r
+               if (inline) {\r
+                       segment = "&#9679;";\r
+               } else {\r
+                       segment = "&#9632;";\r
+               }\r
+\r
                add(new Label("total", String.valueOf(total)));\r
-               add(new Label("insertions", timesRepeat(n.insertions, square)).setEscapeModelStrings(false).setVisible(n.insertions > 0));\r
-               add(new Label("deletions", timesRepeat(n.deletions, square)).setEscapeModelStrings(false).setVisible(n.deletions > 0));\r
-               add(new Label("blank", timesRepeat(n.blanks, square)).setEscapeModelStrings(false).setVisible(n.blanks > 0));\r
+               add(new Label("insertions", timesRepeat(n.insertions, segment)).setEscapeModelStrings(false).setVisible(n.insertions > 0));\r
+               add(new Label("deletions", timesRepeat(n.deletions, segment)).setEscapeModelStrings(false).setVisible(n.deletions > 0));\r
+               add(new Label("blank", timesRepeat(n.blanks, segment)).setEscapeModelStrings(false).setVisible(n.blanks > 0));\r
 \r
                if (inline) {\r
                        WicketUtils.setCssClass(this, "diffstat-inline");\r