]> Git trees. - libqmvoc.git/commitdiff
Get rid of the small table, make much of the code and the UI easier
authorCarsten Niehaus <cniehaus@gmx.de>
Wed, 25 May 2005 15:39:06 +0000 (15:39 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Wed, 25 May 2005 15:39:06 +0000 (15:39 +0000)
svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=418091

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

index 925c99f318b242beb29736e023ac3511619b2453..e58d06f3667aa4096e7e17a4c3a8eed32cceea44 100644 (file)
@@ -286,8 +286,8 @@ QColor Element::currentColor( double temp )
                if ( _az == 4 ) color=Prefs::color_artificial();
        }
 
-       double iButton_melting = melting();
-       double iButton_boiling = boiling();
+       const double iButton_melting = melting();
+       const double iButton_boiling = boiling();
 
        if ( temp < iButton_melting )
        { //the element is solid
@@ -302,8 +302,8 @@ QColor Element::currentColor( double temp )
        { //the element is vaporous
                color= Prefs::color_vapor();
        }
-       return color;
 
+       return color;
 }
 
 void Element::drawHighlight( QPainter* p, int coordinate, bool horizontal )
@@ -332,7 +332,7 @@ void Element::drawHighlight( QPainter* p, int coordinate, bool horizontal )
        p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, Qt::darkRed );
 
        //now draw the elements over the red area
-       drawSelf( p, false );
+       drawSelf( p );
 }
        
 void Element::drawGradient( QPainter* p, const QString& value, const QColor& c)
@@ -371,32 +371,13 @@ void Element::drawGradient( QPainter* p, const QString& value, const QColor& c)
        p->drawRoundRect( X+1, Y+1,ELEMENTSIZE-2,ELEMENTSIZE-2);
 }
 
-void Element::drawSelf( QPainter* p, bool useSimpleView )
+void Element::drawSelf( QPainter* p )
 {
        //the height of a "line" inside an element
        int h_small = 15; //the size for the small units like elementnumber
 
        //The X-coordiante
-       int X = 0;
-       
-       if ( useSimpleView )
-       {//use the small periodic table without the d- and f-Block
-               if ( block() == "f" )
-                       return;
-               if ( block() == "d" )
-                       return;
-               if ( block() == "p" )
-               {
-                       X = ( x-1 )*ELEMENTSIZE;
-                       X -= 10*ELEMENTSIZE;
-               }
-               if ( block() == "s" )
-               {
-                       X = ( x-1 )*ELEMENTSIZE;
-               }
-       }
-       else //use the full table
-               X = ( x-1 )*ELEMENTSIZE;
+       int X = ( x-1 )*ELEMENTSIZE;
 
        //The Y-coordinate
        int Y = ( y-1 )*ELEMENTSIZE;
index 1b29e6cfbf9fd9479437be286bb589b89452891b..301c8bb76588c8fc152484d156ea8752e2c8c141 100644 (file)
@@ -351,7 +351,7 @@ class Element{
                 */
                virtual void drawGradient( QPainter* p, const QString& value, const QColor& );
                
-               virtual void drawSelf( QPainter* p, bool showFullInformation );
+               virtual void drawSelf( QPainter* p );
                
                /**
                 * Highlight perdiods or groups.