dde-dock/frame/util/dockpopupwindow.h
石博文 d772fe206d Fix launcher auto-hide
the popup tips window get active event, so launcher is into deactived
need to forbid tips window get focus.

Change-Id: Idcc01e87e954bde36bd776f466668605f256ddfd
2017-03-06 10:08:59 +08:00

52 lines
1.0 KiB
C++

#ifndef DOCKPOPUPWINDOW_H
#define DOCKPOPUPWINDOW_H
#include "dbus/dbusxmousearea.h"
#include "dbus/dbusdisplay.h"
#include <darrowrectangle.h>
class DockPopupWindow : public Dtk::Widget::DArrowRectangle
{
Q_OBJECT
public:
explicit DockPopupWindow(QWidget *parent = 0);
~DockPopupWindow();
bool model() const;
void setContent(QWidget *content);
public slots:
void show(const QPoint &pos, const bool model = false);
void show(const int x, const int y);
void hide();
signals:
void accept() const;
protected:
void showEvent(QShowEvent *e);
void enterEvent(QEvent *e);
void mousePressEvent(QMouseEvent *e);
bool eventFilter(QObject *o, QEvent *e);
private slots:
void globalMouseRelease(int button, int x, int y, const QString &id);
void registerMouseEvent();
void unRegisterMouseEvent();
private:
bool m_model;
QPoint m_lastPoint;
QString m_mouseAreaKey;
QTimer *m_acceptDelayTimer;
DBusXMouseArea *m_mouseInter;
DBusDisplay *m_displayInter;
};
#endif // DOCKPOPUPWINDOW_H