[PATCH] qgit4: Add a header and set the font family appropriately to the log message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've moved the short log to be the first header row, and highlighted it
more strongly.  I've also set the font family of the log div based on
TYPE_WRITER_FONT as suggested by Marco.

Signed-off-by: Andy Parkins <andyparkins@xxxxxxxxx>
---
 src/git.cpp |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/git.cpp b/src/git.cpp
index 1fa4479..a0873b6 100644
--- a/src/git.cpp
+++ b/src/git.cpp
@@ -979,15 +979,25 @@ const QString Git::getDesc(SCRef sha, QRegExp& shortLogRE, QRegExp& longLogRE) {
 		text = Qt::convertFromPlainText( c->longLog() );
 	else {
 		text = "<html><head><style type=\"text/css\">"
+				"tr.head { background-color: #a0a0e0 }\n"
 				"td.h { font-weight: bold; }\n"
 				"table { background-color: #e0e0f0; }\n"
-				"div.l { white-space: pre; font-family: Monospace; }\n"
-				"</style></head><body>\n";
-		text.append( "<div class='t'><table>\n" );
-		text.append( QString("<tr><td class='h'>Author</th> <td>" + c->author()
-					+ "</td></tr>\n<tr><td class='h'>Date</th><td>") );
+				"span.h { font-weight: bold; font-size: medium; }\n"
+				"div.l { white-space: pre; font-family: ";
+		text.append( TYPE_WRITER_FONT.family() );
+		text.append( "; }\n"
+				"</style></head><body>\n" );
+
+		text.append( "<div class='t'><table border=0 cellspacing=0 cellpadding=2>\n" );
+		text.append("<tr class='head'> <th colspan=2> <span class='h'>" );
+		text.append(colorMatch(c->shortLog(), shortLogRE));
+		text.append("</span></th></tr>\n");
+
+		text.append( QString("<tr><td class='h'>Author</td> <td>" + c->author()
+					+ "</td></tr>\n<tr><td class='h'>Date</td><td>") );
 		text.append(getLocalDate(c->authorDate()));
 		text.append("</td></tr>\n");
+
 		if (!c->isUnApplied && !c->isApplied) {
 			text.append("<tr><td class='h'>Parent</td> <td>").append(c->parents()
 					.join("</td></tr>\n<tr><td class='h'>Parent</td> <td>"));
@@ -1016,8 +1026,7 @@ const QString Git::getDesc(SCRef sha, QRegExp& shortLogRE, QRegExp& longLogRE) {
 			text.append("</td></tr>\n");
 		}
 		text.append( "</table></div>\n" );
-		text.append("\n\n<div class='l'>    " + colorMatch(c->shortLog(), shortLogRE) +
-		            '\n' + colorMatch(c->longLog(), longLogRE));
+		text.append("\n\n<div class='l'>" + colorMatch(c->longLog(), longLogRE));
 		text.append( "</div></body></html>\n" );
 	}
 //	text = Qt::convertFromPlainText(text);
-- 
1.5.0.rc1.gf4b6c

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]