mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 05:49:11 +01:00
4d17a1b0c2
- this solution works stable on mac and ensures that the window get's reopened when the user clicks the dock icon . - tested on 10.8 with Qt4.8.4 and Qt5.0.1 Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
48 lines
858 B
Objective-C
48 lines
858 B
Objective-C
#ifndef MACDOCKICONHANDLER_H
|
|
#define MACDOCKICONHANDLER_H
|
|
|
|
#include <QObject>
|
|
#include <QMainWindow>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QMenu;
|
|
class QIcon;
|
|
class QWidget;
|
|
QT_END_NAMESPACE
|
|
|
|
#ifdef __OBJC__
|
|
@class DockIconClickEventHandler;
|
|
#else
|
|
class DockIconClickEventHandler;
|
|
#endif
|
|
|
|
/** Macintosh-specific dock icon handler.
|
|
*/
|
|
class MacDockIconHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
~MacDockIconHandler();
|
|
|
|
QMenu *dockMenu();
|
|
void setIcon(const QIcon &icon);
|
|
void setMainWindow(QMainWindow *window);
|
|
static MacDockIconHandler *instance();
|
|
|
|
void handleDockIconClickEvent();
|
|
|
|
signals:
|
|
void dockIconClicked();
|
|
|
|
private:
|
|
MacDockIconHandler();
|
|
|
|
DockIconClickEventHandler *m_dockIconClickEventHandler;
|
|
QWidget *m_dummyWidget;
|
|
QMenu *m_dockMenu;
|
|
QMainWindow *mainWindow;
|
|
};
|
|
|
|
#endif // MACDOCKICONCLICKHANDLER_H
|