DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickbehindwindowblur_p_p.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKBEHINDWINDOWBLUR_P_P_H
6#define DQUICKBEHINDWINDOWBLUR_P_P_H
7
8#include "dquickbehindwindowblur_p.h"
9#include "dquickwindow.h"
10
11#include <private/qquickitem_p.h>
12
13DQUICK_BEGIN_NAMESPACE
14
15class DQuickBehindWindowBlurPrivate : public QQuickItemPrivate
16{
17 Q_DECLARE_PUBLIC(DQuickBehindWindowBlur)
18
19public:
21 : windowAttach(nullptr)
22 , blendColor(Qt::transparent)
23 {
24
25 }
27
28 void _q_onHasBlurWindowChanged();
29 void _q_updateBlurArea();
30 bool updateBlurEnable();
31
32 inline bool isValidBlur() const {
33 Q_ASSERT(effectiveBlurEnabled);
34 if (!blurPath.isEmpty())
35 return true;
36 return blurArea.width > 0 && blurArea.height > 0;
37 }
38 inline void makeToInvalidBlur() {
39#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
40 blurPath.clear();
41#else
42 blurPath = QPainterPath();
43#endif
44 blurArea.width = blurArea.height = -1;
45 }
46
47 DQuickWindowAttached *windowAttach = nullptr;
48
49 qreal radius = 0;
50 QColor blendColor;
51 DPlatformHandle::WMBlurArea blurArea;
52 QPainterPath blurPath;
53 bool blurEnabled = true;
54 bool effectiveBlurEnabled = false;
55};
56
57DQUICK_END_NAMESPACE
58
59#endif // DQUICKBEHINDWINDOWBLUR_H_H
Definition dquickbehindwindowblur_p_p.h:16
Definition dquickbehindwindowblur_p.h:19
Definition dquickwindow.h:50