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

完成插件区域的引用图标加载、快捷设置的展示、老插件的加载等功能 Log: 完成特效模式下右侧插件区域的功能 Influence: v23任务栏右侧插件区域 Task: https://pms.uniontech.com/task-view-110311.html Change-Id: I1599907d4529c57070ee2e21b70cc0c17f132e5e
64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
#ifndef TRAYGRIDVIEW_H
|
|
#define TRAYGRIDVIEW_H
|
|
|
|
#include "constants.h"
|
|
|
|
#include <DListView>
|
|
|
|
#include <QPropertyAnimation>
|
|
|
|
DWIDGET_USE_NAMESPACE
|
|
|
|
class TrayGridView : public DListView
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TrayGridView(QWidget *parent = Q_NULLPTR);
|
|
|
|
void setDragDistance(int pixel);
|
|
void setAnimationProperty(const QEasingCurve::Type easing, const int duringTime = 250);
|
|
void moveAnimation();
|
|
const QModelIndex modelIndex(const int index) const;
|
|
const QRect indexRect(const QModelIndex &index) const;
|
|
void dropSwap();
|
|
|
|
Q_SIGNALS:
|
|
void requestRemove(const QString &);
|
|
void dragLeaved();
|
|
void dragEntered();
|
|
|
|
public Q_SLOTS:
|
|
void clearDragModelIndex();
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
|
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
|
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
|
|
|
void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
|
|
void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
|
|
void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
|
|
void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
|
|
void beginDrag(Qt::DropActions supportedActions);
|
|
|
|
private:
|
|
void initUi();
|
|
void createAnimation(const int pos, const bool moveNext, const bool isLastAni);
|
|
|
|
private:
|
|
QEasingCurve::Type m_aniCurveType;
|
|
int m_aniDuringTime;
|
|
|
|
QPoint m_dragPos;
|
|
QPoint m_dropPos;
|
|
|
|
int m_dragDistance;
|
|
|
|
QTimer *m_aniStartTime;
|
|
bool m_pressed;
|
|
bool m_aniRunning;
|
|
};
|
|
|
|
#endif // GRIDVIEW_H
|