1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Fixed focus handling when dropping urls in locationbar.

This commit is contained in:
nowrep 2012-03-01 18:32:53 +01:00
parent c2cf6f8ad2
commit 8b9934b236
6 changed files with 12 additions and 8 deletions

View File

@ -168,7 +168,8 @@ void LocationBar::showMostVisited()
// Workaround: If we show popup when text in locationbar is empty and then // Workaround: If we show popup when text in locationbar is empty and then
// move up and down in completer and then we leave completer -> completer will // move up and down in completer and then we leave completer -> completer will
// set text in locationbar back to last "real" completion // set text in locationbar back to last "real" completion
keyPressEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_unknown, Qt::NoModifier, QString(" "))); QKeyEvent event(QEvent::KeyPress, Qt::Key_unknown, Qt::NoModifier, QString(" "));
keyPressEvent(&event);
} }
m_locationCompleter->showMostVisited(); m_locationCompleter->showMostVisited();
} }
@ -326,6 +327,8 @@ void LocationBar::dropEvent(QDropEvent* event)
m_webView->setFocus(); m_webView->setFocus();
emit loadUrl(dropUrl); emit loadUrl(dropUrl);
QFocusEvent event(QFocusEvent::FocusOut);
QLineEdit::focusOutEvent(&event);
return; return;
} }
} }
@ -337,6 +340,8 @@ void LocationBar::dropEvent(QDropEvent* event)
m_webView->setFocus(); m_webView->setFocus();
emit loadUrl(dropUrl); emit loadUrl(dropUrl);
QFocusEvent event(QFocusEvent::FocusOut);
QLineEdit::focusOutEvent(&event);
return; return;
} }

View File

@ -293,7 +293,9 @@ void WebSearchBar::dropEvent(QDropEvent* event)
QString dropText = event->mimeData()->text(); QString dropText = event->mimeData()->text();
setText(dropText); setText(dropText);
search(); search();
QLineEdit::focusOutEvent(new QFocusEvent(QFocusEvent::FocusOut));
QFocusEvent event(QFocusEvent::FocusOut);
QLineEdit::focusOutEvent(&event);
return; return;
} }
QLineEdit::dropEvent(event); QLineEdit::dropEvent(event);

View File

@ -289,7 +289,7 @@ int TabWidget::addView(QUrl url, const QString &title, const Qz::NewTabPositionF
if (position == -1 && m_newTabAfterActive && !(openFlags & Qz::NT_TabAtTheEnd)) { if (position == -1 && m_newTabAfterActive && !(openFlags & Qz::NT_TabAtTheEnd)) {
// If we are opening newBgTab from pinned tab, make sure it won't be // If we are opening newBgTab from pinned tab, make sure it won't be
// opened between other pinned tabs // opened between other pinned tabs
if (openFlags & Qz::NT_NotSelectedTab && m_lastBackgroundTabIndex != -1) { if (openFlags &Qz::NT_NotSelectedTab && m_lastBackgroundTabIndex != -1) {
position = m_lastBackgroundTabIndex + 1; position = m_lastBackgroundTabIndex + 1;
} }
else { else {

View File

@ -40,10 +40,6 @@ void sigpipe_handler(int s)
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
Q_INIT_RESOURCE(data);
Q_INIT_RESOURCE(icons);
Q_INIT_RESOURCE(html);
#ifdef Q_WS_X11 #ifdef Q_WS_X11
QApplication::setGraphicsSystem("raster"); // Better overall performance on X11 QApplication::setGraphicsSystem("raster"); // Better overall performance on X11

View File

@ -1,4 +1,4 @@
<?php <?php
// Header + Footer // Header + Footer
$site_title = "QupZilla - მარტივი მრავალპლატფორმული ბრაუზერი"; $site_title = "QupZilla - მარტივი მრავალპლატფორმული ბრაუზერი";
$qupzilla = "QupZilla"; $qupzilla = "QupZilla";

View File

@ -16,6 +16,7 @@ TRANSLATIONS += $$PWD/cs_CZ.ts\
$$PWD/sr_RS.ts\ $$PWD/sr_RS.ts\
$$PWD/sv_SE.ts\ $$PWD/sv_SE.ts\
$$PWD/id_ID.ts\ $$PWD/id_ID.ts\
$$PWD/ka_GE.ts\
include(../src/defines.pri) include(../src/defines.pri)