diff options
Diffstat (limited to 'src/webwindow')
-rw-r--r-- | src/webwindow/findbar.cpp | 2 | ||||
-rw-r--r-- | src/webwindow/webwindow.cpp | 23 | ||||
-rw-r--r-- | src/webwindow/webwindow.h | 5 |
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; |