This repository has been archived by the owner on May 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
floatingwidget.h
98 lines (84 loc) · 2.11 KB
/
floatingwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef FLOATINGWIDGET_H
#define FLOATINGWIDGET_H
#include <QWidget>
#include <QPixmap>
#include <QPointer>
#include <QEvent>
#include <QDebug>
#include <QPainter>
#include <QMouseEvent>
#include <QPoint>
#include <QBitmap>
#include <QDropEvent>
#include <QList>
#include <QUrl>
#include <QFile>
#include <QFileInfo>
#include <QMimeData>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QLabel>
#include <QDir>
#include <QDesktopServices>
#include <QIcon>
#include <QFileIconProvider>
#include <QFileSystemModel>
#include <QMimeDatabase>
#include <QMimeType>
#include <qt_windows.h>
#include <QtWinExtras/QtWin>
#include <QtWinExtras/QtWinExtras>
#include <Windows.h>
#include "winutils.h"
#include <cmath>
#include "settingsutils.h"
#include <iostream>
#include "shortcutwidget.h"
#include <QHideEvent>
class SpiritSettingsForm;
class FloatingWidget : public QWidget
{
Q_OBJECT
public:
explicit FloatingWidget(int id,QWidget *parent = nullptr);
bool inuse;
int id;
protected:
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *);
void dragEnterEvent(QDragEnterEvent *);
void dropEvent(QDropEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mouseDoubleClickEvent(QMouseEvent *);
void hideEvent(QHideEvent *);
void showShortcuts();
void hideShortcuts();
void modifyIcon(QString path);
QPoint relativePos;
QString iconPath;
QPixmap icon;
SpiritSettingsForm *form;
const qreal ALPHA = 0.8;
const double RADIUS = 100;
const double PI = 3.1415;
const int OX = 400;
const int OY = 400;
const int OW = 75;
const int OH = 75;
const int CW = 50;
const int CH = 50;
const int W = std::max((int)(OX+OW/2),(int)(OX+RADIUS+CW/2));
const int H = std::max((int)(OY+OH/2),(int)(OY+RADIUS+CH/2));
const int DIAGR2 = (OW*OW+OH*OH)/4;
bool showshortcuts;
QTimer *mouseOutTimer;
QList<ShortcutWidget*> shortcuts;
private:
signals:
public slots:
void mouseOut3s();
};
#endif // FLOATINGWIDGET_H