aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets/WideBar.h
blob: 2b676a8cb9d76293e9c89fad576530046811a6e3 (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
#pragma once

#include <QToolBar>
#include <QAction>
#include <QMap>

class QMenu;

class WideBar : public QToolBar
{
    Q_OBJECT

public:
    explicit WideBar(const QString &title, QWidget * parent = nullptr);
    explicit WideBar(QWidget * parent = nullptr);
    virtual ~WideBar();

    void addAction(QAction *action);
    void addSeparator();
    void insertSpacer(QAction *action);
    void insertActionBefore(QAction *before, QAction *action);
    QMenu *createContextMenu(QWidget *parent = nullptr, const QString & title = QString());

private:
    struct BarEntry;
    QList<BarEntry *> m_entries;
};