[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Mon Aug 18 08:59:02 CEST 2008


SVN commit 848577 by harris:

Applying patch from Mederic Boquien.  Quoting his message:

"I have made a patch to correct a few problems on the FOV tool:
 * It was not possible to use the semitransparent FOV because in kstars.kcfg,
 the max index was set to 3 whereas the semitransparent FOV had index #4. When
 selecting a semitransparent FOV, it switched back to #3 (bull's eye)
 * Now the FOV preview is anti-aliased and the text indicating the FOV size is
 correctly centred
 * Now the semitransparent FOV is really semitransparent using the alpha
 channel and not filled with a not-so-pretty pattern
 * After having edited a FOV, the preview in the dialog containing the list of
 FOV is updated"
 
Thanks, Mederic!

CCMAIL: kstars-devel at kde.org



 M  +3 -1      fov.cpp  
 M  +4 -0      fovdialog.cpp  
 M  +2 -2      kstars.kcfg  
 M  +1 -1      kstarsinit.cpp  
 M  +2 -1      widgets/fovwidget.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/fov.cpp #848576:848577
@@ -129,7 +129,9 @@
         }
     case 4: { // Solid Circle
             int s = int( pixelsize );
-            p.setBrush( QBrush ( QColor( color() ), Qt::Dense4Pattern) );
+            QColor colorAlpha( color() );
+            colorAlpha.setAlpha(127);
+            p.setBrush( QBrush ( colorAlpha ) );
             p.drawEllipse( (w - s)/2, (h - s)/2, s, s );
             p.setBrush(Qt::NoBrush);
             break;
--- trunk/KDE/kdeedu/kstars/kstars/fovdialog.cpp #848576:848577
@@ -165,6 +165,10 @@
         //(see Qt4 porting guide at doc.trolltech.com)
         delete FOVList[ currentItem() ];
         FOVList[ currentItem() ] = newfov;
+
+        //paint dialog with edited FOV symbol
+        fov->ViewBox->setFOV( FOVList[ currentItem() ] );
+        fov->ViewBox->update();
     }
 }
 
--- trunk/KDE/kdeedu/kstars/kstars/kstars.kcfg #848576:848577
@@ -235,9 +235,9 @@
 		</entry>
 		<entry name="FOVShape" type="UInt">
 			<label>Shape of selected FOV</label>
-			<whatsthis>Integer indicating the selected FOV symbol shape.  Possible values are: 0=Square; 1=Circle; 2=Crosshairs; 3=Bullseye.</whatsthis>
+			<whatsthis>Integer indicating the selected FOV symbol shape.  Possible values are: 0=Square; 1=Circle; 2=Crosshairs; 3=Bullseye; 4=Semitransparent circle.</whatsthis>
 			<default>0</default>
-			<max>3</max>
+			<max>4</max>
 		</entry>
 		<entry name="FOVSize" type="Double">
 			<label>Angular size of selected FOV indicator, in arcmin</label>
--- trunk/KDE/kdeedu/kstars/kstars/kstarsinit.cpp #848576:848577
@@ -513,7 +513,7 @@
             QTextStream ostream(&f);
             ostream << i18nc( "Do not use a field-of-view indicator", "No FOV" ) <<  ":0.0:0:#AAAAAA" << endl;
             ostream << i18nc( "use field-of-view for binoculars", "7x35 Binoculars" ) << ":558:1:#AAAAAA" << endl;
-						ostream << i18nc( "use a Telrad field-of-view indicator", "Telrad" ) << ":30:3:#AA0000" << endl;
+            ostream << i18nc( "use a Telrad field-of-view indicator", "Telrad" ) << ":30:3:#AA0000" << endl;
             ostream << i18nc( "use 1-degree field-of-view indicator", "One Degree" ) << ":60:2:#AAAAAA" << endl;
             ostream << i18nc( "use HST field-of-view indicator", "HST WFPC2" ) << ":2.4:0:#AAAAAA" << endl;
             ostream << i18nc( "use Radiotelescope HPBW", "30m at 1.3cm" ) << ":1.79:1:#AAAAAA" << endl;
--- trunk/KDE/kdeedu/kstars/kstars/widgets/fovwidget.cpp #848576:848577
@@ -35,6 +35,7 @@
 void FOVWidget::paintEvent( QPaintEvent * ) {
     QPainter p;
     p.begin( this );
+    p.setRenderHint( QPainter::Antialiasing, true );
     p.fillRect( contentsRect(), QColor( "black" ) );
 
     if ( m_FOV ) {
@@ -43,7 +44,7 @@
             QFont smallFont = p.font();
             smallFont.setPointSize( p.font().pointSize() - 2 );
             p.setFont( smallFont );
-            p.drawText( 0, contentsRect().height(), i18nc("angular size in arcminutes", "%1 arcmin", QString::number( m_FOV->size(), 'f', 1 ) ) );
+            p.drawText( rect(), Qt::AlignHCenter|Qt::AlignBottom, i18nc("angular size in arcminutes", "%1 arcmin", QString::number( m_FOV->size(), 'f', 1 ) ) );
         }
     }
 


More information about the Kstars-devel mailing list