diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-17 13:36:08 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-17 13:36:08 +0200 |
commit | 1e99b19616f102b57f52dfc01ea3ccdb6a24a607 (patch) | |
tree | 120672a1635e3bc2110b780d93afbfe0a9f30216 /src/mainwindow | |
parent | Address bar searches work again (diff) | |
download | smolbote-1e99b19616f102b57f52dfc01ea3ccdb6a24a607.tar.xz |
Add loading progess bar to the address bar
Diffstat (limited to 'src/mainwindow')
-rw-r--r-- | src/mainwindow/mainwindow.cpp | 13 | ||||
-rw-r--r-- | src/mainwindow/mainwindow.h | 4 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index 6af530a..df5e1c8 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -23,7 +23,7 @@ #include <QUrl> #include <about/aboutdialog.h> #include <configuration/configuration.h> -#include "addressbar/urllineedit.h" +#include "addressbar/addressbar.h" MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent) : QMainWindow(parent) @@ -48,16 +48,9 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent) addToolBar(Qt::TopToolBarArea, navigationToolBar); navigationToolBar->connectWebView(nullptr); - QHash<QString, QString> a; - addressBar = new UrlLineEdit(a, this); + addressBar = new AddressBar(config->section("addressbar"), this); navigationToolBar->addWidget(addressBar); - auto *focusShortcut = new QShortcut(QKeySequence("F4"), this); - connect(focusShortcut, &QShortcut::activated, this, [this]() { - addressBar->setFocus(); - addressBar->selectAll(); - }); - setCentralWidget(mdiArea); mdiArea->setFocus(); @@ -74,7 +67,7 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent) }); addressBar->connectWebView(w->currentView()); - addressBarConnection = connect(w, &Window::currentViewChanged, addressBar, &UrlLineEdit::connectWebView); + addressBarConnection = connect(w, &Window::currentViewChanged, addressBar, &AddressBar::connectWebView); navigationToolBar->connectWebView(w->currentView()); navigationBarConnection = connect(w, &Window::currentViewChanged, navigationToolBar, &NavigationBar::connectWebView); } diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index ad879c3..38ab746 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -16,7 +16,7 @@ class Browser; class QMdiArea; class Configuration; class Window; -class UrlLineEdit; +class AddressBar; class MainWindow : public QMainWindow { friend class Browser; @@ -47,7 +47,7 @@ protected: private: QString titleSuffix; QMenu *toolsMenu = nullptr; - UrlLineEdit *addressBar; + AddressBar *addressBar; QMdiArea *mdiArea; std::shared_ptr<Configuration> m_config; |