feat(WideBar): Allow disabling alt shortcuts

Signed-off-by: leo78913 <leo3758@riseup.net>
This commit is contained in:
leo78913
2023-01-08 22:47:38 -03:00
parent f3acf35aea
commit b2de01b076
4 changed files with 30 additions and 13 deletions

View File

@ -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);
@ -49,6 +52,8 @@ class WideBar : public QToolBar {
private:
QList<BarEntry> m_entries;
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;