feat(WideBar): custom context menu actions

Signed-off-by: leo78913 <leo3758@riseup.net>
This commit is contained in:
leo78913
2023-01-10 12:02:02 -03:00
parent 55d4064335
commit f16989bea9
3 changed files with 16 additions and 0 deletions

View File

@ -30,6 +30,8 @@ class WideBar : public QToolBar {
QMenu* createContextMenu(QWidget* parent = nullptr, const QString& title = QString());
void showVisibilityMenu(const QPoint&);
void addContextMenuAction(QAction* action);
// Ideally we would use a QBitArray for this, but it doesn't support string conversion,
// so using it in settings is very messy.
@ -52,6 +54,8 @@ class WideBar : public QToolBar {
private:
QList<BarEntry> m_entries;
QList<QAction*> m_context_menu_actions;
bool m_use_default_action = false;
// Menu to toggle visibility from buttons in the bar