首次提交

This commit is contained in:
2026-06-16 13:33:27 +08:00
commit 81e2f99ab5
187 changed files with 26001 additions and 0 deletions
@@ -0,0 +1,59 @@
#pragma once
#include <QColor>
#include <QDebug>
#include <QLinearGradient>
#include <QList>
#include <QMap>
#include <QPixmap>
#include <QString>
#include <QWidget>
enum RectType { R11, R12, R13, R21, R22, R23, R31, R32, R33, null, Drag_R};
using changeSize = std::function<void()>;
class FrameLessWidget : public QWidget {
public:
explicit FrameLessWidget(QWidget* parent = nullptr);
int topMargin;
int bottomMargin;
int rightMargin;
int leftMargin;
int space;
QRect r11, r12, r13, r21, r22, r23, r31, r32, r33;
int x1{}, x2{}, x3{}, y1{}, y2{}, y3{};
bool changingSize = false;
bool drag_moving = false;
RectType curR = null;
int startX{};
int startY{};
int startGlobalX{};
int startGlobalY{};
int startW{};
int startH{};
int dx{}, dy{};
QList<Qt::CursorShape> shapes;
QList<changeSize> changeSizes;
int radius;
QColor background_color = QColor(150, 150, 150, 130);
virtual int getMinWidth();
virtual int getMinHeight();
void setPos();
void setRs();
[[nodiscard]] RectType getRectType(const QPoint& pos) const;
// window->showFullScreen();
// window->showNormal();
// window->showMinimized();
// window->showMaximized();
protected:
void paintEvent(QPaintEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* event) override;
bool event(QEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
void showEvent(QShowEvent* event) override;
};