summaryrefslogtreecommitdiff
path: root/src/panels/tabtoolbar.hpp
blob: 1c61ed2afd0059d9d93fdd78c23a9babeb5e932c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
};