summaryrefslogtreecommitdiff
path: root/src/urlbar/urlbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/urlbar/urlbar.cpp')
-rw-r--r--src/urlbar/urlbar.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index d9059833..f3a34a36 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -10,7 +10,8 @@
* Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
* ============================================================ */
-#include "urlbar.h"
+#include "urlbar.hpp"
+#include "completer.hpp"
#include <QApplication>
#include <QClipboard>
#include <QPaintEvent>
@@ -50,9 +51,7 @@ UrlBar::UrlBar(QWidget *parent)
: QLineEdit(parent), _icon(new IconButton(this)), backgroundColor{qApp->palette().color(QPalette::Base)},
highlightColor{qApp->palette().color(QPalette::Highlight)}
{
-
// set initial icon
- //_icon->setIcon(QIcon("arrow-right"));
_icon->setIcon(QIcon::fromTheme("arrow-right"));
_icon->show();
@@ -75,10 +74,9 @@ UrlBar::UrlBar(QWidget *parent)
// accept focus, via tabbing, clicking & wheeling
setFocusPolicy(Qt::WheelFocus);
- // TODO: disable completion object (we have our own :) )
- // setCompletionObject(0);
-
- //_tab = qobject_cast<WebTab *>(parent);
+ // set completer
+ auto *completer = new UrlSuggester(this);
+ connect(this, &QLineEdit::textEdited, completer, &UrlSuggester::showCompletions);
// connect(_tab, SIGNAL(loadProgressing()), this, SLOT(update()));