changeset 386:7ef46fb73b48 item_appearance_adjustments

Use rounded rectangles throughout
author Chris Cannam
date Tue, 24 May 2011 14:05:35 +0100
parents 5cc0d897eb26
children ce6a70970808
files src/changesetdetailitem.cpp src/changesetitem.cpp src/uncommitteditem.cpp
diffstat 3 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/changesetdetailitem.cpp	Tue May 24 13:29:27 2011 +0100
+++ b/src/changesetdetailitem.cpp	Tue May 24 14:05:35 2011 +0100
@@ -86,7 +86,7 @@
 
     QRectF r(0.5, 0.5, width - 1, height - 1);
     paint->setBrush(Qt::white);
-    paint->drawRect(r);
+    paint->drawRoundedRect(r, 10, 10);
 
     if (scale < 0.1) {
 	paint->restore();
--- a/src/changesetitem.cpp	Tue May 24 13:29:27 2011 +0100
+++ b/src/changesetitem.cpp	Tue May 24 14:05:35 2011 +0100
@@ -306,27 +306,33 @@
         paint->setBrush(Qt::white);
 
         if (m_current) {
-            paint->drawRect(QRectF(x0 - 4, -4, width + 5, height + 8));
+            paint->drawRoundedRect(QRectF(x0 - 4, -4, width + 5, height + 8),
+                                   10, 10);
         }
 
         if (m_new) {
             paint->save();
             paint->setPen(Qt::yellow);
             paint->setBrush(Qt::NoBrush);
-            paint->drawRect(QRectF(x0 - 2, -2, width + 1, height + 4));
+            paint->drawRoundedRect(QRectF(x0 - 2, -2, width + 1, height + 4),
+                                   10, 10);
             paint->restore();
         }
     }
 
-    paint->drawRect(r);
-
     if (!showText) {
+        paint->drawRoundedRect(r, 7, 7);
 	paint->restore();
 	return;
     }
 
-    paint->fillRect(QRectF(x0 + 0.5, 0.5, width - 4, fh - 0.5),
-		    QBrush(userColour));
+    paint->save();
+    paint->setPen(Qt::NoPen);
+    paint->drawRoundedRect(r, 7, 7);
+    paint->setBrush(QBrush(userColour));
+    paint->drawRoundedRect(QRectF(x0 + 0.5, 0.5, width - 4, fh - 0.5), 7, 7);
+    paint->drawRect(QRectF(x0 + 0.5, fh/2, width - 4, fh/2));
+    paint->restore();
 
     paint->setPen(QPen(Qt::white));
 
@@ -358,6 +364,10 @@
         }
     }
 
+    paint->setPen(QPen(branchColour, 2));
+    paint->setBrush(Qt::NoBrush);
+    paint->drawRoundedRect(r, 7, 7);
+
     if (m_showBranch) {
 	// write branch name
         paint->save();
--- a/src/uncommitteditem.cpp	Tue May 24 13:29:27 2011 +0100
+++ b/src/uncommitteditem.cpp	Tue May 24 14:05:35 2011 +0100
@@ -137,7 +137,7 @@
     int height = 49;
     QRectF r(x0, 0, width - 3, height);
     paint->setBrush(Qt::white);
-    paint->drawRect(r);
+    paint->drawRoundedRect(r, 7, 7);
 
     if (m_wide) {
         QString label = tr("Uncommitted changes");