mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00

DRegionMonitor从dtk的widget移动到了gui模块,但为了兼容,widget模块中还存在,要避免项目同时加载了两个模块中的DRegionMonitor类 Log: 编译问题 Influence: 编译问题 Change-Id: I8bd5d7350f6bda3d21b32685d086c79e3781b766
60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
|
|
//
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
#ifndef DOCKPOPUPWINDOW_H
|
|
#define DOCKPOPUPWINDOW_H
|
|
|
|
#include <darrowrectangle.h>
|
|
#include <DRegionMonitor>
|
|
#include <DWindowManagerHelper>
|
|
|
|
DGUI_USE_NAMESPACE
|
|
|
|
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;
|
|
// 在把专业版的仓库降级到debian的stable时, dock出现了一个奇怪的问题:
|
|
// 在plugins/tray/system-trays/systemtrayitem.cpp中的showPopupWindow函数中
|
|
// 无法连接到上面这个信号: "accept", qt给出一个运行时警告提示找不到信号
|
|
// 目前的解决方案就是在下面增加了这个信号
|
|
void unusedSignal();
|
|
|
|
protected:
|
|
void showEvent(QShowEvent *e);
|
|
void enterEvent(QEvent *e);
|
|
bool eventFilter(QObject *o, QEvent *e);
|
|
void blockButtonRelease();
|
|
|
|
private slots:
|
|
void onGlobMouseRelease(const QPoint &mousePos, const int flag);
|
|
void compositeChanged();
|
|
void ensureRaised();
|
|
|
|
private:
|
|
bool m_model;
|
|
QPoint m_lastPoint;
|
|
|
|
DRegionMonitor *m_regionInter;
|
|
DWindowManagerHelper *m_wmHelper;
|
|
bool m_enableMouseRelease;
|
|
};
|
|
|
|
#endif // DOCKPOPUPWINDOW_H
|