summaryrefslogtreecommitdiff
path: root/src/findbar.cpp
diff options
context:
space:
mode:
authorPanagiotis Papadopoulos <pano_90@gmx.net>2009-12-09 17:23:35 +0100
committerPanagiotis Papadopoulos <pano_90@gmx.net>2009-12-09 17:23:35 +0100
commitba21553e2e6ce17fc4ad84b5ab587b4e7bc5345c (patch)
tree64f7b3a5cec066f06268e954899a78523dcaedf5 /src/findbar.cpp
parentChange a bit the WebKit settings UI (diff)
parentxss attach prevention. (diff)
downloadrekonq-ba21553e2e6ce17fc4ad84b5ab587b4e7bc5345c.tar.xz
Merge branch 'master' of git://gitorious.org/rekonq/mainline into click-to-flash-ui
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);
}
-
-