[qet] [3531] Comment item & cross ref item : reduce the size of the rectangle where is display the comment for better visual

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3531
Author:   blacksun
Date:     2014-12-05 00:14:20 +0100 (Fri, 05 Dec 2014)
Log Message:
-----------
Comment item & cross ref item : reduce the size of the rectangle where is display the comment for better visual

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/commentitem.cpp
    trunk/sources/qetgraphicsitem/crossrefitem.cpp

Modified: trunk/sources/qetgraphicsitem/commentitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/commentitem.cpp	2014-12-04 10:57:21 UTC (rev 3530)
+++ trunk/sources/qetgraphicsitem/commentitem.cpp	2014-12-04 23:14:20 UTC (rev 3531)
@@ -121,7 +121,7 @@
 				 painter.setPen  (pen);
 				 painter.setFont (QETApp::diagramTextsFont(6));
 
-		QRectF drawing_rect(QPointF(0,0), QSizeF(100, 100));
+		QRectF drawing_rect(QPointF(0,0), QSizeF(70, 100));
 		QRectF text_bounding;
 
 		painter.drawText(drawing_rect, Qt::TextWordWrap | Qt::AlignHCenter, m_comment, &text_bounding);

Modified: trunk/sources/qetgraphicsitem/crossrefitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-12-04 10:57:21 UTC (rev 3530)
+++ trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-12-04 23:14:20 UTC (rev 3531)
@@ -504,14 +504,15 @@
 void CrossRefItem::AddExtraInfo(QPainter &painter) {
 	QString comment = m_element-> elementInformations()["comment"].toString();
 	bool must_show = m_element-> elementInformations().keyMustShow("comment");
+
 	if (!comment.isEmpty() && must_show) {
 		painter.save();
 		painter.setFont(QETApp::diagramTextsFont(6));
 
 		QRectF r, text_bounding;
 		qreal center = boundingRect().center().x();
-		r = QRectF(QPointF(center - 50, boundingRect().bottom()),
-				   QPointF(center + 50, boundingRect().bottom() + 50));
+		r = QRectF(QPointF(center - 35, boundingRect().bottom()),
+				   QPointF(center + 35, boundingRect().bottom() + 50));
 		painter.drawText(r, Qt::TextWordWrap | Qt::AlignHCenter, comment, &text_bounding);
 
 		text_bounding.adjust(-1,0,1,0); //adjust only for better visual


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/