-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: Tray: Make Options menu clickable
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "clickablemenu.h" | ||
|
||
#include <QMouseEvent> | ||
|
||
ClickableMenu::ClickableMenu(QWidget *parent) : QMenu(parent) | ||
{ | ||
setAttribute(Qt::WA_WindowPropagation); // to inherit default font | ||
} | ||
|
||
void ClickableMenu::mousePressEvent(QMouseEvent *event) | ||
{ | ||
QMenu::mousePressEvent(event); | ||
|
||
emit clicked(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef CLICKABLEMENU_H | ||
#define CLICKABLEMENU_H | ||
|
||
#include <QMenu> | ||
|
||
class ClickableMenu : public QMenu | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ClickableMenu(QWidget *parent = nullptr); | ||
|
||
signals: | ||
void clicked(); | ||
|
||
protected: | ||
void mousePressEvent(QMouseEvent *event) override; | ||
}; | ||
|
||
#endif // CLICKABLEMENU_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters