aboutsummaryrefslogtreecommitdiff
path: root/lib/navigation/navigationbutton.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/navigation/navigationbutton.h')
-rw-r--r--lib/navigation/navigationbutton.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/navigation/navigationbutton.h b/lib/navigation/navigationbutton.h
new file mode 100644
index 0000000..7c76b9c
--- /dev/null
+++ b/lib/navigation/navigationbutton.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of smolbote. It's copyrighted by the contributors recorded
+ * in the version control history of the file, available from its original
+ * location: git://neueland.iserlohn-fortress.net/smolbote.git
+ *
+ * SPDX-License-Identifier: GPL-3.0
+ */
+
+#ifndef NAVIGATIONBUTTON_H
+#define NAVIGATIONBUTTON_H
+
+#include <QToolButton>
+#include "../../src/webengine/webview.h"
+
+class QMenu;
+
+class NavigationButton : public QToolButton
+{
+ Q_OBJECT
+public:
+
+ enum Type {
+ BackButton,
+ ForwardButton,
+ ReloadButton,
+ StopButton
+ };
+
+ explicit NavigationButton(Type type, QWidget *parent = nullptr);
+
+ void setView(WebView *view);
+
+signals:
+
+private slots:
+ void updateOnLoadStarted();
+ void updateOnLoadFinished();
+ void doAction();
+ void prepareMenu();
+
+private:
+ Type m_type;
+ QMenu *menu;
+ WebView *m_view;
+
+ QMetaObject::Connection loadStartedConnection, loadFinishedConnection;
+};
+
+#endif // NAVIGATIONBUTTON_H