2016-07-15 11:00:55 +08:00
|
|
|
#ifndef DOCKPOPUPWINDOW_H
|
|
|
|
#define DOCKPOPUPWINDOW_H
|
|
|
|
|
2016-07-18 10:09:26 +08:00
|
|
|
#include "dbus/dbusxmousearea.h"
|
2016-08-30 15:11:09 +08:00
|
|
|
#include "dbus/dbusdisplay.h"
|
2016-07-18 10:09:26 +08:00
|
|
|
|
2016-07-15 11:00:55 +08:00
|
|
|
#include <darrowrectangle.h>
|
|
|
|
|
|
|
|
class DockPopupWindow : public Dtk::Widget::DArrowRectangle
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit DockPopupWindow(QWidget *parent = 0);
|
2016-07-19 15:08:16 +08:00
|
|
|
~DockPopupWindow();
|
2016-07-15 11:00:55 +08:00
|
|
|
|
|
|
|
bool model() const;
|
|
|
|
|
2016-07-27 14:08:23 +08:00
|
|
|
void setContent(QWidget *content);
|
|
|
|
|
2016-07-18 10:09:26 +08:00
|
|
|
public slots:
|
2016-07-15 11:00:55 +08:00
|
|
|
void show(const QPoint &pos, const bool model = false);
|
2016-07-19 15:08:16 +08:00
|
|
|
void hide();
|
2016-07-15 11:00:55 +08:00
|
|
|
|
2016-07-18 10:09:26 +08:00
|
|
|
signals:
|
|
|
|
void accept() const;
|
|
|
|
|
|
|
|
protected:
|
2016-09-01 10:55:19 +08:00
|
|
|
void enterEvent(QEvent *e);
|
2016-07-18 10:09:26 +08:00
|
|
|
void mousePressEvent(QMouseEvent *e);
|
2016-07-27 14:08:23 +08:00
|
|
|
bool eventFilter(QObject *o, QEvent *e);
|
2016-07-18 10:09:26 +08:00
|
|
|
|
|
|
|
private slots:
|
2016-07-20 16:30:56 +08:00
|
|
|
void globalMouseRelease(int button, int x, int y, const QString &id);
|
2016-08-26 17:38:30 +08:00
|
|
|
void registerMouseEvent();
|
|
|
|
void unRegisterMouseEvent();
|
2016-07-18 10:09:26 +08:00
|
|
|
|
2016-08-01 11:26:39 +08:00
|
|
|
private:
|
|
|
|
using Dtk::Widget::DArrowRectangle::show;
|
|
|
|
|
2016-07-15 11:00:55 +08:00
|
|
|
private:
|
|
|
|
bool m_model;
|
2016-07-27 14:08:23 +08:00
|
|
|
QPoint m_lastPoint;
|
2016-07-18 10:09:26 +08:00
|
|
|
QString m_mouseAreaKey;
|
|
|
|
|
|
|
|
QTimer *m_acceptDelayTimer;
|
|
|
|
|
|
|
|
DBusXMouseArea *m_mouseInter;
|
2016-08-30 15:11:09 +08:00
|
|
|
DBusDisplay *m_displayInter;
|
2016-07-15 11:00:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DOCKPOPUPWINDOW_H
|