* Add workaround for using QCursor::pos() * Set window flags and parent of TrayMenu to it is shown like a context menu
47 lines
743 B
C++
47 lines
743 B
C++
#ifndef TRAY_MENU_H
|
|
#define TRAY_MENU_H
|
|
|
|
#include <QMenu>
|
|
|
|
namespace QtGui {
|
|
|
|
class TrayIcon;
|
|
class TrayWidget;
|
|
|
|
class TrayMenu : public QMenu {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TrayMenu(TrayIcon *trayIcon = nullptr, QWidget *parent = nullptr);
|
|
|
|
QSize sizeHint() const override;
|
|
TrayWidget &widget();
|
|
const TrayWidget &widget() const;
|
|
TrayIcon *icon();
|
|
|
|
public slots:
|
|
void showUsingPositioningSettings();
|
|
|
|
private:
|
|
TrayWidget *m_trayWidget;
|
|
TrayIcon *m_trayIcon;
|
|
};
|
|
|
|
inline TrayWidget &TrayMenu::widget()
|
|
{
|
|
return *m_trayWidget;
|
|
}
|
|
|
|
inline const TrayWidget &TrayMenu::widget() const
|
|
{
|
|
return *m_trayWidget;
|
|
}
|
|
|
|
inline TrayIcon *TrayMenu::icon()
|
|
{
|
|
return m_trayIcon;
|
|
}
|
|
} // namespace QtGui
|
|
|
|
#endif // TRAY_MENU_H
|