diff options
author | flow <flowlnlnln@gmail.com> | 2023-01-27 10:55:49 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 10:55:49 -0800 |
commit | c78db5459ef7afbc8fd5a5b81b03f672f94235bc (patch) | |
tree | a6f8721160996ab1720dacd3cf8844524987485a /launcher/ui/widgets/WideBar.h | |
parent | f705cf09bce828ea2f8bae918673c1d921713866 (diff) | |
parent | a27564ed70861c0b6676e870c2965332fbd2bf45 (diff) | |
download | PrismLauncher-c78db5459ef7afbc8fd5a5b81b03f672f94235bc.tar.gz PrismLauncher-c78db5459ef7afbc8fd5a5b81b03f672f94235bc.tar.bz2 PrismLauncher-c78db5459ef7afbc8fd5a5b81b03f672f94235bc.zip |
Merge pull request #724 from leo78913/dot-ui-mainwindow
Closes https://github.com/PrismLauncher/PrismLauncher/issues/594
Closes https://github.com/PrismLauncher/PrismLauncher/issues/69
Closes https://github.com/PrismLauncher/PrismLauncher/issues/473
Diffstat (limited to 'launcher/ui/widgets/WideBar.h')
-rw-r--r-- | launcher/ui/widgets/WideBar.h | 10 |
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; |