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

List:       kde-commits
Subject:    playground/base/blazer
From:       Ian Reinhart Geiser <geiseri () kde ! org>
Date:       2009-02-13 14:47:36
Message-ID: 1234536456.542807.11561.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 925570 by geiseri:

fixed focus problem with the run bar. next step is to make it optional so it wont \
confuse people who wont use it.

 M  +21 -2     launcherbar.cpp  
 M  +2 -0      launcherbar.h  
 M  +2 -7      topbar.cpp  


--- trunk/playground/base/blazer/launcherbar.cpp #925569:925570
@@ -24,11 +24,14 @@
 #include <KDE/KLocale>
 #include <KDE/KRun>
 #include <KDE/KMessageBox>
+#include <kdebug.h>
 
 #include <kurifilter.h>
 #include <kdebug.h>
 #include <QHBoxLayout>
 #include <QLabel>
+#include <QEvent>
+#include <QLineEdit>
 
 LauncherBar::LauncherBar( QWidget *parent ) : QFrame(parent)
 {
@@ -38,11 +41,14 @@
 
     QLabel *text = new QLabel(i18n("Run:"), this);
     m_input = new KHistoryComboBox(this);
+    m_input->setFocus();
     m_input->clearEditText();
-    connect(m_input, SIGNAL(activated(const QString&)), this, SLOT(execute(const \
QString&))); +    m_input->installEventFilter(this);
+    m_input->lineEdit()->installEventFilter(this);
+    connect(m_input, SIGNAL(activated(const QString&)),
+            this, SLOT(execute(const QString&)));
     layout->addWidget( text );
     layout->addWidget( m_input,1);
-
 }
 
 void LauncherBar::execute( const QString &execLine )
@@ -101,3 +107,16 @@
     m_input->clearEditText();
     return;
 }
+
+bool LauncherBar::eventFilter(QObject *obj, QEvent *event)
+{
+    if (event->type() == QEvent::MouseButtonPress )
+    {
+        m_input->lineEdit()->activateWindow();
+        return true;
+    }
+    else
+    {
+        return QObject::eventFilter(obj, event);
+    }
+}
--- trunk/playground/base/blazer/launcherbar.h #925569:925570
@@ -31,6 +31,8 @@
 public:
     LauncherBar( QWidget *parent );
 
+protected:
+    bool eventFilter(QObject *obj, QEvent *event);
 private slots:
     void execute( const QString &execLine );
 
--- trunk/playground/base/blazer/topbar.cpp #925569:925570
@@ -55,7 +55,6 @@
 
     m_launcher = new LauncherBar(this);
 
-
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->addWidget(m_button);
     layout->addWidget(m_media);
@@ -65,8 +64,7 @@
     layout->setSpacing(0);
     layout->setMargin(0);
 
-    KWindowSystem::setType( winId(), NET::Dock ); // <- why cant i get focus here
-    KWindowSystem::setState( winId(), NET::Sticky | NET::KeepAbove | \
NET::SkipTaskbar| NET::SkipPager ); +    KWindowSystem::setType( winId(), NET::Dock \
);  KWindowSystem::setOnAllDesktops( winId(), true );
 }
 
@@ -76,8 +74,8 @@
     {
         QRect screenGeometry = \
QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen());  \
                int screenWidth = screenGeometry.width();
-        setGeometry(screenGeometry.x(), 0, screenWidth, panelSize );
         setFixedSize( screenWidth, panelSize );
+        setGeometry(screenGeometry.x(), 0, screenWidth, panelSize );
         // FIXME: make this work on dual head.
         KWindowSystem::setExtendedStrut( winId(), 0, 0, 0, 
                                                   0, 0, 0, 
@@ -91,7 +89,6 @@
     setObjectName("BottomPanel");
     m_tasks = new TaskManagerWidget(this);
 
-
     QWidget *spacer = new QWidget(this);
 
     m_pager = new Pager(this);
@@ -105,7 +102,6 @@
     layout->setMargin(1);
 
     KWindowSystem::setType( winId(), NET::Dock );
-    KWindowSystem::setState( winId(), NET::Sticky | NET::KeepAbove | NET::SkipPager \
| NET::SkipPager );  KWindowSystem::setOnAllDesktops( winId(), true );
 }
 
@@ -126,4 +122,3 @@
     }
     m_tasks->setMaximumWidth( width() - m_pager->width() );
 }
-


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

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