[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.1/kdeedu/kstars/kstars
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2008-08-21 0:05:33
Message-ID: 1219277133.482016.24157.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 850201 by harris:

Backporting fix for FOV symbols (trunk r848577).  Original commit
message fllows:

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!




 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  


--- branches/KDE/4.1/kdeedu/kstars/kstars/fov.cpp #850200:850201
@@ -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;
--- branches/KDE/4.1/kdeedu/kstars/kstars/fovdialog.cpp #850200:850201
@@ -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();
     }
 }
 
--- branches/KDE/4.1/kdeedu/kstars/kstars/kstars.kcfg #850200:850201
@@ -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>
--- branches/KDE/4.1/kdeedu/kstars/kstars/kstarsinit.cpp #850200:850201
@@ -507,7 +507,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;
--- branches/KDE/4.1/kdeedu/kstars/kstars/widgets/fovwidget.cpp #850200:850201
@@ -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 ) ) );  }
     }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic