[Kstars-devel] branches/KDE/4.1/kdeedu/kstars/kstars/widgets

Akarsh Simha akarshsimha at gmail.com
Mon Dec 8 12:01:45 CET 2008


SVN commit 894259 by asimha:

Applying Médéric's patch fixing bug 157318. The theme's colours are
correctly set now. (Backporting to 4.1 branch)

CCMAIL: kstars-devel at kde.org




 M  +3 -8      dmsbox.cpp  
 M  +0 -1      dmsbox.h  


--- branches/KDE/4.1/kdeedu/kstars/kstars/widgets/dmsbox.cpp #894258:894259
@@ -24,24 +24,21 @@
 
 #include <QRegExp>
 #include <QFocusEvent>
+#include <QApplication>
 
 dmsBox::dmsBox(QWidget *parent, bool dg)
         : KLineEdit(parent), EmptyFlag(true) {
     setMaxLength(14);
     setMaximumWidth(160);
     setDegType( dg );
-    psave = palette();
 
-    //Somehow, the color is getting reset to grey already!
-    psave.setColor( QPalette::Active, QPalette::Text, Qt::black );
-
     connect( this, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotTextChanged( const QString & ) ) );
 }
 
 void dmsBox::setEmptyText() {
     //Set the text color to the average between
     //QColorGroup::Text and QColorGroup::Base
-    QPalette p = psave;
+    QPalette p=QApplication::palette();
     QColor txc = p.color( QPalette::Active, QPalette::Text );
     QColor bgc = p.color( QPalette::Active, QPalette::Base );
     int r( ( txc.red()   + bgc.red()   )/2 );
@@ -65,7 +62,7 @@
 
     if ( EmptyFlag ) {
         clear();
-        setPalette( psave );
+        setPalette( QApplication::palette() );
         EmptyFlag = false;
     }
 }
@@ -81,7 +78,6 @@
 void dmsBox::slotTextChanged( const QString &t ) {
     if ( ! hasFocus() ) {
         if ( EmptyFlag && ! t.isEmpty() ) {
-            setPalette( psave );
             EmptyFlag = false;
         }
 
@@ -120,7 +116,6 @@
     setWhatsThis( sWhatsThis );
 
     clear();
-    setPalette( psave );
     EmptyFlag = false;
     setEmptyText();
 }
--- branches/KDE/4.1/kdeedu/kstars/kstars/widgets/dmsbox.h #894258:894259
@@ -144,7 +144,6 @@
     int second_int, msecond;
     bool deg, EmptyFlag;
     dms degValue;
-    QPalette psave;
 };
 
 #endif


More information about the Kstars-devel mailing list