aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets/WideBar.h
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/widgets/WideBar.h')
-rw-r--r--launcher/ui/widgets/WideBar.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/launcher/ui/widgets/WideBar.h b/launcher/ui/widgets/WideBar.h
index a0a7896c..c47f3a59 100644
--- a/launcher/ui/widgets/WideBar.h
+++ b/launcher/ui/widgets/WideBar.h
@@ -9,6 +9,9 @@
class WideBar : public QToolBar {
Q_OBJECT
+ // Why: so we can enable / disable alt shortcuts in toolbuttons
+ // with toolbuttons using setDefaultAction, theres no alt shortcuts
+ Q_PROPERTY(bool useDefaultAction MEMBER m_use_default_action)
public:
explicit WideBar(const QString& title, QWidget* parent = nullptr);
@@ -22,10 +25,13 @@ class WideBar : public QToolBar {
void insertSeparator(QAction* before);
void insertActionBefore(QAction* before, QAction* action);
void insertActionAfter(QAction* after, QAction* action);
+ void insertWidgetBefore(QAction* before, QWidget* widget);
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.
@@ -48,6 +54,10 @@ 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
std::unique_ptr<QMenu> m_bar_menu = nullptr;
enum class MenuState { Fresh, Dirty } m_menu_state = MenuState::Dirty;