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

List:       kde-commits
Subject:    koffice/kexi/koproperty2/koproperty/editors
From:       Adam Pigg <adam () piggz ! co ! uk>
Date:       2009-08-09 20:09:46
Message-ID: 1249848586.267281.20887.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1009363 by piggz:

Add some styling, and fix the return value if option extraValueAllowed is true

 M  +19 -2     combobox.cpp  


--- trunk/koffice/kexi/koproperty2/koproperty/editors/combobox.cpp #1009362:1009363
@@ -28,7 +28,7 @@
 #include <QVariant>
 #include <QPainter>
 #include <QHBoxLayout>
-
+#include <kcolorscheme.h>
 #include <KDebug>
 
 #include "Property.h"
@@ -90,6 +90,19 @@
         w->setStyleSheet(QString());
     }*/
     //QComboBoxPrivateContainer
+    
+    
+    //Set the stylesheet to a plain style
+    QString styleSheet;
+    KColorScheme cs(QPalette::Active);
+    QColor focus = cs.decoration(KColorScheme::FocusColor).color();
+
+    styleSheet = QString("QComboBox { \
+    border: 1px solid %1; \
+    border-radius: 0px; \
+    padding: 0px 18px; }").arg(focus.name());
+   
+    setStyleSheet(styleSheet);
 }
 
 ComboBox::~ComboBox()
@@ -271,8 +284,12 @@
     //kDebug() << "property->value()==" << property->value();
     const int idx = listData->keys.indexOf( property->value() );
     //kDebug() << "idx==" << idx;
-    if (idx == -1)
+    if (idx == -1) {
+      if (!property->option("extraValueAllowed").toBool())
         return QString();
+      else
+	return property->value().toString();
+    }
     return property->listData()->names[ idx ];
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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