diff options
| author | megabigbug <megabigbug@arrakis.(none)> | 2009-12-06 14:30:22 +0100 | 
|---|---|---|
| committer | megabigbug <megabigbug@arrakis.(none)> | 2009-12-06 14:30:22 +0100 | 
| commit | 9002b5d3c4f1677e5bc98b77956150a136f83b7f (patch) | |
| tree | 561ddf76cd5bc14799430e1f56b358a5bfa1d390 | |
| parent | trivial change in src/CMakeLists.txt (diff) | |
| download | rekonq-9002b5d3c4f1677e5bc98b77956150a136f83b7f.tar.xz | |
Hide findBar after one minute
| -rw-r--r-- | src/findbar.cpp | 12 | ||||
| -rw-r--r-- | src/findbar.h | 1 | 
2 files changed, 10 insertions, 3 deletions
diff --git a/src/findbar.cpp b/src/findbar.cpp index 09cc46f1..bd1a5137 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -45,12 +45,14 @@  #include <QtGui/QColor>  #include <QtGui/QKeyEvent>  #include <QtCore/QString> +#include <QtCore/QTimer>  FindBar::FindBar(KMainWindow *mainwindow)          : QWidget(mainwindow)          , m_lineEdit(new KLineEdit(this))          , m_matchCase(new QCheckBox(i18n("&Match case"), this)) +        , m_hideTimer(new QTimer(this))  {      QHBoxLayout *layout = new QHBoxLayout; @@ -65,6 +67,9 @@ FindBar::FindBar(KMainWindow *mainwindow)      layout->addWidget(hideButton);      layout->setAlignment(hideButton, Qt::AlignLeft | Qt::AlignTop); +    // hide timer  +    connect(m_hideTimer, SIGNAL(timeout()), this, SLOT(hide())); +      // label      QLabel *label = new QLabel(i18n("Find:"));      layout->addWidget(label); @@ -92,7 +97,7 @@ FindBar::FindBar(KMainWindow *mainwindow)      layout->addStretch();      setLayout(layout); - +          // we start off hidden      hide();  } @@ -132,6 +137,7 @@ void FindBar::show()          return;      QWidget::show(); +    m_hideTimer->start(60000);  } @@ -140,6 +146,7 @@ void FindBar::keyPressEvent(QKeyEvent* event)      if (event->key() == Qt::Key_Escape)      {          hide(); +        m_hideTimer->stop();          return;      }      if (event->key() == Qt::Key_Return && !m_lineEdit->text().isEmpty()) @@ -171,6 +178,5 @@ void FindBar::notifyMatch(bool match)          }      }      m_lineEdit->setPalette(p); +    m_hideTimer->start(60000);  } - - diff --git a/src/findbar.h b/src/findbar.h index 0818d010..fa369f66 100644 --- a/src/findbar.h +++ b/src/findbar.h @@ -67,6 +67,7 @@ signals:  private:      KLineEdit *m_lineEdit;      QCheckBox *m_matchCase; +    QTimer *m_hideTimer;  };  | 
