aboutsummaryrefslogtreecommitdiff
path: root/src/addressbar/urllineedit.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-04-16 17:07:36 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-04-16 17:07:36 +0200
commitd796821f8304306dbe088701724243b39e8eb358 (patch)
tree836c85aa421db5c495e2b36f6a02cea924b6d919 /src/addressbar/urllineedit.cpp
parentBranch of Qt5.11 features (diff)
downloadsmolbote-d796821f8304306dbe088701724243b39e8eb358.tar.xz
Multiple subwindows interface
Subwindows are similar to tab groups. - Rewrote Browser and MainWindow, so they should be somewhat cleaner now - Moved AboutDialog to lib/about What's broken: - loading bar - search box - address bar bookmark suggestions - plugins
Diffstat (limited to 'src/addressbar/urllineedit.cpp')
-rw-r--r--src/addressbar/urllineedit.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/addressbar/urllineedit.cpp b/src/addressbar/urllineedit.cpp
index cf2c08b..8aa03c7 100644
--- a/src/addressbar/urllineedit.cpp
+++ b/src/addressbar/urllineedit.cpp
@@ -7,6 +7,7 @@
*/
#include "urllineedit.h"
+#include "webengine/webview.h"
#include <QLabel>
#include <QMenu>
#include <QShortcut>
@@ -18,19 +19,13 @@ UrlLineEdit::UrlLineEdit(const QHash<QString, QString> &config, QWidget *parent)
: QLineEdit(parent)
, m_listView(new Completer(this))
{
- auto *focusShortcut = new QShortcut(QKeySequence(config.value("addressbar.shortcuts.focus")), parent);
- connect(focusShortcut, &QShortcut::activated, this, [this]() {
- setFocus();
- selectAll();
- });
-
setPlaceholderText(tr("Enter address"));
m_listView->setVisible(false);
connect(this, &UrlLineEdit::textEdited, this, &UrlLineEdit::updateCompleter);
m_pageMenuAction = addAction(style()->standardIcon(QStyle::SP_DriveNetIcon), QLineEdit::LeadingPosition);
- m_pageMenuAction->setShortcut(QKeySequence(config.value("addressbar.shortcuts.pageMenu")));
+ m_pageMenuAction->setShortcut(QKeySequence("F2"));
m_pageMenuAction->setToolTip(tr("Page Actions (%1)").arg(m_pageMenuAction->shortcut().toString()));
connect(m_pageMenuAction, &QAction::triggered, m_pageMenuAction, [&]() {
if(m_pageMenuAction->menu()) {
@@ -39,7 +34,7 @@ UrlLineEdit::UrlLineEdit(const QHash<QString, QString> &config, QWidget *parent)
});
m_toolsMenuAction = addAction(style()->standardIcon(QStyle::SP_FileIcon), QLineEdit::TrailingPosition);
- m_toolsMenuAction->setShortcut(QKeySequence(config.value("addressbar.shortcuts.toolsMenu")));
+ m_toolsMenuAction->setShortcut(QKeySequence("F10"));
m_toolsMenuAction->setToolTip(tr("Tools (%1)").arg(m_toolsMenuAction->shortcut().toString()));
connect(m_toolsMenuAction, &QAction::triggered, m_toolsMenuAction, [&]() {
if(m_toolsMenuAction->menu()) {
@@ -56,7 +51,11 @@ UrlLineEdit::UrlLineEdit(const QHash<QString, QString> &config, QWidget *parent)
if(this->text().startsWith('#')) {
emit searchTermEntered(this->text().mid(1));
} else {
- emit addressEntered(QUrl::fromUserInput(this->text()));
+ if(m_view) {
+ m_view->load(QUrl::fromUserInput(this->text()));
+ } else {
+ this->clear();
+ }
}
this->clearFocus();
});
@@ -71,6 +70,7 @@ void UrlLineEdit::setCompleterModel(BookmarksView *model)
void UrlLineEdit::connectWebView(WebView *view)
{
Q_CHECK_PTR(view);
+ m_view = view;
disconnect(urlChangedConnection);