summaryrefslogtreecommitdiff
path: root/src/findbar.cpp
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2009-12-06 14:30:22 +0100
committermegabigbug <megabigbug@arrakis.(none)>2009-12-06 14:30:22 +0100
commit9002b5d3c4f1677e5bc98b77956150a136f83b7f (patch)
tree561ddf76cd5bc14799430e1f56b358a5bfa1d390 /src/findbar.cpp
parenttrivial change in src/CMakeLists.txt (diff)
downloadrekonq-9002b5d3c4f1677e5bc98b77956150a136f83b7f.tar.xz
Hide findBar after one minute
Diffstat (limited to 'src/findbar.cpp')
-rw-r--r--src/findbar.cpp12
1 files changed, 9 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);
}
-
-