aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/widgets/navigationbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow/widgets/navigationbar.h')
-rw-r--r--src/mainwindow/widgets/navigationbar.h41
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