summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-30 18:37:53 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commitf150b053b75a845fdb907475eddb7c5fc6aa2bf8 (patch)
treec1f4b6fe1357db65fd63f07e23f3611d9e39f52d /src
parentFix default zoom shortcut (diff)
downloadrekonq-f150b053b75a845fdb907475eddb7c5fc6aa2bf8.tar.xz
work on the findbar
restored find next/previous shortcuts set to 20 secs the timeout to auto hide findbar restored hide it on ESC key
Diffstat (limited to 'src')
-rw-r--r--src/webwindow/findbar.cpp2
-rw-r--r--src/webwindow/webwindow.cpp23
-rw-r--r--src/webwindow/webwindow.h5
3 files changed, 27 insertions, 3 deletions
diff --git a/src/webwindow/findbar.cpp b/src/webwindow/findbar.cpp
index e95f860e..e4d8ccfb 100644
--- a/src/webwindow/findbar.cpp
+++ b/src/webwindow/findbar.cpp
@@ -184,7 +184,7 @@ void FindBar::setVisible(bool visible)
emit searchString(m_lineEdit->text());
}
- m_hideTimer->start(60000);
+ m_hideTimer->start(20000);
m_lineEdit->setFocus();
m_lineEdit->selectAll();
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index 8e6a6e4b..697ecba7 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -230,6 +230,9 @@ void WebWindow::setupActions()
KShortcut findShortcut = KStandardShortcut::find();
a->setShortcut(findShortcut);
+ KStandardAction::findNext(m_findBar, SLOT(findNext()), actionCollection());
+ KStandardAction::findPrev(m_findBar, SLOT(findPrevious()), actionCollection());
+
a = KStandardAction::fullScreen(this, SLOT(setWidgetsHidden(bool)), this, actionCollection());
KShortcut fullScreenShortcut = KStandardShortcut::fullScreen();
fullScreenShortcut.setAlternate(Qt::Key_F11);
@@ -617,7 +620,7 @@ void WebWindow::notifyMessage(const QString &msg)
const bool horizontalScrollbarIsVisible = _tab->page()->currentFrame()->scrollBarMaximum(Qt::Horizontal);
const bool verticalScrollbarIsVisible = _tab->page()->currentFrame()->scrollBarMaximum(Qt::Vertical);
- const bool actionBarsVisible = false; //m_findBar->isVisible() || m_zoomBar->isVisible();
+ const bool actionBarsVisible = m_findBar->isVisible(); // NOTE: actually we have just the finbar down there...
const int scrollbarExtent = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
const int hScrollbarSize = horizontalScrollbarIsVisible ? scrollbarExtent : 0;
@@ -936,3 +939,21 @@ void WebWindow::openHomePage(Qt::MouseButtons buttons, Qt::KeyboardModifiers mod
else
load(homeUrl);
}
+
+
+void WebWindow::keyPressEvent(QKeyEvent *kev)
+{
+ if (kev->key() == Qt::Key_Escape)
+ {
+ // if findbar is visible, hide it
+ if (m_findBar->isVisible())
+ {
+ m_findBar->hide();
+ kev->accept();
+ checkFocus();
+ return;
+ }
+ }
+
+ return QWidget::keyPressEvent(kev);
+}
diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h
index d955e814..ffd65477 100644
--- a/src/webwindow/webwindow.h
+++ b/src/webwindow/webwindow.h
@@ -149,7 +149,10 @@ Q_SIGNALS:
void pageCreated(WebPage *);
void setFullScreen(bool);
-
+
+protected:
+ void keyPressEvent(QKeyEvent *);
+
private:
int _progress;