From 1e99b19616f102b57f52dfc01ea3ccdb6a24a607 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 17 Apr 2018 13:36:08 +0200 Subject: Add loading progess bar to the address bar --- src/mainwindow/mainwindow.cpp | 13 +++---------- src/mainwindow/mainwindow.h | 4 ++-- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'src/mainwindow') 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 #include #include -#include "addressbar/urllineedit.h" +#include "addressbar/addressbar.h" MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) : QMainWindow(parent) @@ -48,16 +48,9 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) addToolBar(Qt::TopToolBarArea, navigationToolBar); navigationToolBar->connectWebView(nullptr); - QHash 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 &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 m_config; -- cgit v1.2.1