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

List:       kde-commits
Subject:    KDE/kdeplasma-addons/applets/unitconverter
From:       Petri Damstén <petri.damsten () kdemail ! net>
Date:       2010-10-11 6:58:22
Message-ID: 20101011065822.D0F26AC7E4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1184638 by pdamsten:

Raise applet above other when combobox is clicked so drop down list will be above other applets.
BUG:244255

 M  +17 -4     unitconverter.cpp  
 M  +14 -0     unitconverter.h  


--- trunk/KDE/kdeplasma-addons/applets/unitconverter/unitconverter.cpp #1184637:1184638
@@ -26,7 +26,6 @@
 #include <QRegExp>
 #include <KComboBox>
 #include <KLineEdit>
-#include <Plasma/ComboBox>
 #include <Plasma/LineEdit>
 #include <Plasma/Label>
 #include <Plasma/Frame>
@@ -34,6 +33,17 @@
 
 using namespace KUnitConversion;
 
+ComboBox::ComboBox(QGraphicsWidget* parent)
+    : Plasma::ComboBox(parent)
+{
+}
+
+void ComboBox::mousePressEvent(QGraphicsSceneMouseEvent* event)
+{
+    emit mousePressed();
+    Plasma::ComboBox::mousePressEvent(event);
+}
+
 Q_DECLARE_METATYPE(UnitPtr)
 Q_DECLARE_METATYPE(UnitCategory*)
 
@@ -170,11 +180,14 @@
         Plasma::Label *pLabel = new Plasma::Label(this);
         pLabel->nativeWidget()->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
         pLabel->setText(i18n("Convert:"));
-        m_pCmbCategory = new Plasma::ComboBox(this);
+        m_pCmbCategory = new ComboBox(this);
+        connect(m_pCmbCategory, SIGNAL(mousePressed()), this, SLOT(raise()));
         m_pCmbCategory->setZValue(2);
 
-        m_pCmbUnit1 = new Plasma::ComboBox(this);
-        m_pCmbUnit2 = new Plasma::ComboBox(this);
+        m_pCmbUnit1 = new ComboBox(this);
+        m_pCmbUnit2 = new ComboBox(this);
+        connect(m_pCmbUnit1, SIGNAL(mousePressed()), this, SLOT(raise()));
+        connect(m_pCmbUnit2, SIGNAL(mousePressed()), this, SLOT(raise()));
         m_pCmbUnit1->setZValue(1);
         m_pCmbUnit2->setZValue(1);
         m_pTxtValue1 = new Plasma::LineEdit(this);
--- trunk/KDE/kdeplasma-addons/applets/unitconverter/unitconverter.h #1184637:1184638
@@ -22,6 +22,7 @@
 #define UNITCONVERTER_H
 
 #include <Plasma/PopupApplet>
+#include <Plasma/ComboBox>
 #include <KUnitConversion/Converter>
 
 namespace Plasma {
@@ -30,6 +31,19 @@
     class Label;
 }
 
+class ComboBox : public Plasma::ComboBox
+{
+    Q_OBJECT
+public:
+    ComboBox(QGraphicsWidget* parent = 0);
+
+signals:
+    void mousePressed();
+
+protected:
+    virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
+};
+
 // Define our plasma Applet
 class UnitConverter : public Plasma::PopupApplet
 {
[prev in list] [next in list] [prev in thread] [next in thread] 

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