diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-16 17:07:36 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-16 17:07:36 +0200 |
commit | d796821f8304306dbe088701724243b39e8eb358 (patch) | |
tree | 836c85aa421db5c495e2b36f6a02cea924b6d919 /src/mainwindow/widgets/navigationbar.h | |
parent | Branch of Qt5.11 features (diff) | |
download | smolbote-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/mainwindow/widgets/navigationbar.h')
-rw-r--r-- | src/mainwindow/widgets/navigationbar.h | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/src/mainwindow/widgets/navigationbar.h b/src/mainwindow/widgets/navigationbar.h index fd0579d..1b4cc05 100644 --- a/src/mainwindow/widgets/navigationbar.h +++ b/src/mainwindow/widgets/navigationbar.h @@ -6,36 +6,21 @@ * SPDX-License-Identifier: GPL-3.0 */ -/* - * Why is this class a QObject and not a QWidget, and why don't we add the - * NavigationBar itself to the toolbar? - * That was the original idea: make a NavBar class, friend it from MainWindow - * to gain access to the config, but there's a couple of issues: - * - adding QToolButtons to a widget that's inside a toolbar makes the buttons - * look absolutely hideous: they're smaller and have a border for some reason - * - if you stylesheet the border away (which is a pain), they're still not - * the same size - * And so we ended up having this class only exist to contain all of the logic - * for the nav buttons (which cuts down the code in MainWindow). - */ - -#ifndef NAVIGATIONBAR_H -#define NAVIGATIONBAR_H +#ifndef SMOLBOTE_NAVIGATIONBAR_H +#define SMOLBOTE_NAVIGATIONBAR_H -#include <QObject> +#include <QToolBar> -class QStyle; -class QToolBar; -class QToolButton; -class MainWindow; +class UrlLineEdit; class WebView; -class NavigationBar : public QObject +class NavigationBar : public QToolBar { Q_OBJECT + public: - explicit NavigationBar(MainWindow *parent = nullptr); + explicit NavigationBar(const QHash<QString, QString> &conf, QWidget *parent = nullptr); - void addWidgetsTo(QToolBar *toolBar); +public slots: void connectWebView(WebView *view); private slots: @@ -45,11 +30,13 @@ private slots: private: QStyle *qStyle; WebView *m_view; - QToolButton *backButton, *forwardButton; - QToolButton *stopReloadButton; - QToolButton *homeButton; + + QAction *backAction, *forwardAction; + QAction *stopReloadAction; + QAction *homeAction; + UrlLineEdit *addressBar; QMetaObject::Connection loadStartedConnection, loadFinishedConnection; }; -#endif //NAVIGATIONBAR_H +#endif // SMOLBOTE_NAVIGATIONBAR_H |