summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp2
-rw-r--r--src/findbar.cpp15
-rw-r--r--src/findbar.h2
-rw-r--r--src/mainview.cpp6
-rw-r--r--src/mainwindow.cpp1
-rw-r--r--src/webtab.cpp3
6 files changed, 18 insertions, 11 deletions
diff --git a/src/application.cpp b/src/application.cpp
index cfd4d060..14fd5ce0 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -382,8 +382,8 @@ void Application::loadResolvedUrl(ThreadWeaver::Job *job)
if (view)
{
- view->setFocus();
view->load(url);
+ view->setFocus();
// we are sure of the url now, let's add it to history
// anyway we store here just http sites because local and ftp ones are
diff --git a/src/findbar.cpp b/src/findbar.cpp
index bd1a5137..9efb9c6a 100644
--- a/src/findbar.cpp
+++ b/src/findbar.cpp
@@ -143,12 +143,6 @@ void FindBar::show()
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())
{
emit searchString(m_lineEdit->text());
@@ -158,6 +152,7 @@ void FindBar::keyPressEvent(QKeyEvent* event)
QWidget::keyPressEvent(event);
}
+
void FindBar::notifyMatch(bool match)
{
QPalette p = m_lineEdit->palette();
@@ -180,3 +175,11 @@ void FindBar::notifyMatch(bool match)
m_lineEdit->setPalette(p);
m_hideTimer->start(60000);
}
+
+
+
+void FindBar::hide()
+{
+ m_hideTimer->stop();
+ QWidget::hide();
+}
diff --git a/src/findbar.h b/src/findbar.h
index fa369f66..5a41c0bc 100644
--- a/src/findbar.h
+++ b/src/findbar.h
@@ -56,6 +56,7 @@ public:
public slots:
void clear();
void show();
+ void hide();
void notifyMatch(bool match);
protected Q_SLOTS:
@@ -68,7 +69,6 @@ private:
KLineEdit *m_lineEdit;
QCheckBox *m_matchCase;
QTimer *m_hideTimer;
-
};
#endif
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 02823d3b..57185fd2 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -312,7 +312,7 @@ void MainView::currentChanged(int index)
Application::instance()->mainWindow()->setZoomSliderFactor(tab->view()->zoomFactor());
// set focus to the current webview
- tab->setFocus();
+ tab->view()->setFocus();
}
@@ -511,8 +511,8 @@ void MainView::closeTab(int index)
}
removeTab(index);
- updateTabBar(); // UI operation: do it ASAP!!
- tab->deleteLater(); // webView is scheduled for deletion.
+ updateTabBar(); // UI operation: do it ASAP!!
+ tab->deleteLater(); // webView is scheduled for deletion.
emit tabsChanged();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 30e5a061..e4890b72 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -960,6 +960,7 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
if (event->key() == Qt::Key_Escape)
{
m_findBar->hide();
+ currentTab()->setFocus(); // give focus to web pages
return;
}
diff --git a/src/webtab.cpp b/src/webtab.cpp
index b1f2cdfc..b3eb71f0 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -64,6 +64,9 @@ WebTab::WebTab(QWidget* parent)
, m_view( new WebView(this) )
, m_progress(0)
{
+ // fix focus handling
+ setFocusProxy( m_view );
+
QVBoxLayout* l = new QVBoxLayout(this);
l->setMargin(0);
l->setSpacing(0);