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

不影响默认行为,默认该配置为 0 即立刻显示或恢复 如果需要可以进行 dconfig 配置 Log: 添加配置显示桌面的悬浮时间 Change-Id: I0b394bf02717b6ba1abe1e5c86fab82d314f39fc
36 lines
837 B
C++
36 lines
837 B
C++
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
|
|
//
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
#ifndef DESKTOP_WIDGET_H
|
|
#define DESKTOP_WIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QPaintEvent>
|
|
#include <QEnterEvent>
|
|
#include <QTimer>
|
|
|
|
class DesktopWidget : public QWidget
|
|
{
|
|
public:
|
|
explicit DesktopWidget(QWidget *parent = nullptr);
|
|
|
|
void setToggleDesktopInterval(int ms);
|
|
private:
|
|
bool checkNeedShowDesktop();
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
void enterEvent(QEvent *event) override;
|
|
void leaveEvent(QEvent *event) override;
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
void toggleDesktop();
|
|
|
|
private:
|
|
bool m_isHover; // 判断鼠标是否移到desktop区域
|
|
bool m_needRecoveryWin;
|
|
QTimer *m_timer;
|
|
};
|
|
|
|
#endif // DESKTOP_WIDGET_H
|