]> Git trees. - libqmvoc.git/commitdiff
complete the sync with the 3.5 branch
authorPino Toscano <pino@kde.org>
Thu, 1 Sep 2005 18:53:00 +0000 (18:53 +0000)
committerPino Toscano <pino@kde.org>
Thu, 1 Sep 2005 18:53:00 +0000 (18:53 +0000)
svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=455955

kalzium/src/element.cpp
kalzium/src/element.h

index 26f49118ae5a2718ee55b411ccdc72da9684f398..0367c0950d95f2bdfe69aa6137faea37e94b8dc2 100644 (file)
@@ -341,6 +341,29 @@ void Element::drawGradient( QPainter* p, const QString& value, const QColor& c)
        p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1);
 }
 
+void Element::drawGrayedOut( QPainter *p )
+{ 
+       //The X-coordiante
+       int X = xPos();
+       
+       //The Y-coordinate
+       int Y = yPos();
+       
+       p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, Qt::lightGray );
+       
+       p->setPen( Qt::darkGray );
+       
+       QFont symbol_font = p->font();
+       const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 );
+       int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p );
+       symbol_font.setPointSize( goodsize );
+       p->setFont( symbol_font );
+       p->drawText( X+1,Y+5, ELEMENTSIZE-2,ELEMENTSIZE-10,Qt::AlignCenter, symbol() );
+
+       p->setPen( Qt::black );
+       p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1);
+}
+
 void Element::drawSelf( QPainter* p, bool simple, bool isCrystal )
 {
        //the height of a "line" inside an element
index e0212dd1c8d3be656187b03b82c9afee2e245f87..78e736cc8b44d6c0ca17181f44337f671bd47288 100644 (file)
@@ -494,6 +494,12 @@ class Element{
                 */
                virtual void drawGradient( QPainter* p, const QString& value, const QColor& c);
                
+               /**
+                * Draw the Element grayed out. Used in the timeline
+                * @param p the painter used for the painting
+                */
+               virtual void drawGrayedOut( QPainter* p );
+               
                /**
                 * draw the rectangle with the information
                 * @param p painter to do the drawing on