DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
darrowrectangle_p.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DARROWRECTANGLE_P_H
6#define DARROWRECTANGLE_P_H
7
8#include <DArrowRectangle>
9
10#include <DWindowManagerHelper>
11#include <DObjectPrivate>
12
13#include <QPointer>
14
15DGUI_USE_NAMESPACE
16DWIDGET_BEGIN_NAMESPACE
17
18class DArrowRectanglePrivate : public DTK_CORE_NAMESPACE::DObjectPrivate
19{
20 D_DECLARE_PUBLIC(DArrowRectangle)
21
22public:
24
25 void init(DArrowRectangle::FloatMode floatMode);
26
27 virtual void show(int x, int y);
28 void setContent(QWidget *content);
29 void resizeWithContent();
30 void paintEvent(QPaintEvent *e);
31 void resizeEvent(QResizeEvent *e);
32
33 QPainterPath getLeftCornerPath();
34 QPainterPath getRightCornerPath();
35 QPainterPath getTopCornerPath();
36 QPainterPath getBottomCornerPath();
37
38 const QRect currentScreenRect(const int x, const int y);
39
40 void verticalMove(int x, int y);
41 void horizontalMove(int x, int y);
42
43 void updateClipPath();
44
45 bool radiusEnabled();
46
47public:
48 int m_radius = 3;
49 int m_arrowHeight = 8;
50 int m_arrowWidth = 12;
51 int m_margin = 5;
52 int m_arrowX = 0;
53 int m_arrowY = 0;
54
55 qreal m_shadowBlurRadius = 20;
56 qreal m_shadowDistance = 0;
57 qreal m_shadowXOffset = 0;
58 qreal m_shadowYOffset = 5;
59 int m_shadowWidth = 5; //Abandoned
60 int m_borderWidth = 1;
61 QColor m_borderColor = QColor(0, 0, 0, 255 * 0.1);
62 QColor m_backgroundColor;
63
64 DArrowRectangle::ArrowDirection m_arrowDirection;
65 QPoint m_lastPos = QPoint(0, 0);
66
67 DArrowRectangle::FloatMode floatMode = DArrowRectangle::FloatWindow;
68 QPointer<QWidget> m_content;
69 DPlatformWindowHandle *m_handle = nullptr;
70 DBlurEffectWidget *m_blurBackground = nullptr;
71 DWindowManagerHelper *m_wmHelper = nullptr;
72 bool leftRightRadius = false;
73 bool radiusArrowStyleEnable = false;
74};
75
76DWIDGET_END_NAMESPACE
77
78#endif // DARROWRECTANGLE_P_H
Definition darrowrectangle_p.h:19
DArrowRectangle 提供了可以在四个边中的任意一个边显示箭头的矩形控件.
Definition darrowrectangle.h:24
FloatMode
FloatMode 表示不同的控件的浮动模式
Definition darrowrectangle.h:38
ArrowDirection
箭头方向枚举包含 DArrowRectangle 的箭头可能指向的可能方向.
Definition darrowrectangle.h:31
用于实现主窗口或控件背景的实时模糊效果.
Definition dblureffectwidget.h:17
Definition dplatformwindowhandle.h:19