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

List:       kstars-devel
Subject:    [Kstars-devel] Proposed patch for semi-transparent label BG
From:       Jason Harris <jharris () 30doradus ! org>
Date:       2007-11-25 18:01:06
Message-ID: 200711251101.06722.kstars () 30doradus ! org
[Download RAW message or body]

Hello,

I just committed a patch to restore the semi-transparent background of our 
on-screen infoboxes.

I would like to use the same semi-transparent background for object labels, 
instead of the current opaque background using the sky color.  My proposed 
patch is attached[1].  I think it looks a lot better this way.  The only 
potential drawback is some confusion when labels overlap, but IMO, it's not 
that bad.

For 4.1, I would make the the rendering of label BGs an option (full opaque, 
semi-transparent, or full transparent), but for now I'd like to hard-code the 
semi-transparent rendering.

Any objections?

regards,
Jason

[1]: cd $KDESOURCE/kdeedu/kstars/kstars; patch -p0 < semitrans_labels.patch

["semitrans_labels.patch" (text/x-diff)]

Index: starobject.cpp
===================================================================
--- starobject.cpp	(revision 741403)
+++ starobject.cpp	(working copy)
@@ -400,8 +400,10 @@
     QFontMetricsF fm = SkyLabeler::Instance()->fontMetrics();
     qreal width = fm.width( sName );
     qreal height = fm.height();
+
+    //FIXME: Implement label background options
     QColor color( KStarsData::Instance()->colorScheme()->colorNamed( "SkyColor" ) );
-    psky.fillRect( QRectF( x+offset, y+offset - height * 0.7, width, height ), \
QBrush( color ) ); +    psky.fillRect( QRectF( x+offset, y+offset - height * 0.7, \
width, height ), QBrush( color, Qt::Dense4Pattern ) );  
     if ( Options::useAntialias() )
         psky.drawText( QPointF( x+offset, y+offset ), sName );
Index: skyobject.cpp
===================================================================
--- skyobject.cpp	(revision 741403)
+++ skyobject.cpp	(working copy)
@@ -431,8 +431,10 @@
     QFontMetricsF fm = SkyLabeler::Instance()->fontMetrics();
     qreal width = fm.width( translatedName() );
     qreal height = fm.height();
+
+    //FIXME: Implement label background options
     QColor color( KStarsData::Instance()->colorScheme()->colorNamed( "SkyColor" ) );
-    psky.fillRect( QRectF( x+offset, y+offset - height * 0.7, width, height ), \
QBrush( color ) ); +    psky.fillRect( QRectF( x+offset, y+offset - height * 0.7, \
width, height ), QBrush( color, Qt::Dense4Pattern ) );  
     if ( Options::useAntialias() )
         psky.drawText( QPointF(x+offset, y+offset), translatedName() );



_______________________________________________
Kstars-devel mailing list
Kstars-devel@kde.org
https://mail.kde.org/mailman/listinfo/kstars-devel


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

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