summaryrefslogtreecommitdiff
path: root/src/panels/tabtoolbar.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/panels/tabtoolbar.hpp')
-rw-r--r--src/panels/tabtoolbar.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/panels/tabtoolbar.hpp b/src/panels/tabtoolbar.hpp
new file mode 100644
index 00000000..1c61ed2a
--- /dev/null
+++ b/src/panels/tabtoolbar.hpp
@@ -0,0 +1,33 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================ */
+
+#pragma once
+
+#include "tabbar/tabbar.h"
+#include <QToolBar>
+
+class TabToolBar : public QToolBar {
+ Q_OBJECT
+
+public:
+ explicit TabToolBar(QWidget *parent = nullptr);
+ ~TabToolBar() override = default;
+
+ int addView(RekonqView *view);
+ void setCurrentView(RekonqView *view);
+ [[nodiscard]] RekonqView *currentView() const;
+
+signals:
+ void currentViewChanged(RekonqView *view);
+ void tabClosed(RekonqView *view);
+
+public slots:
+ void closeCurrentTab() { emit tabs->tabCloseRequested(tabs->currentIndex()); }
+
+private:
+ TabBar *tabs;
+};