aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets/WideBar.h
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2023-01-27 10:55:49 -0800
committerGitHub <noreply@github.com>2023-01-27 10:55:49 -0800
commitc78db5459ef7afbc8fd5a5b81b03f672f94235bc (patch)
treea6f8721160996ab1720dacd3cf8844524987485a /launcher/ui/widgets/WideBar.h
parentf705cf09bce828ea2f8bae918673c1d921713866 (diff)
parenta27564ed70861c0b6676e870c2965332fbd2bf45 (diff)
downloadPrismLauncher-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.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;