DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dblureffectwidget_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 DBLUREFFECTWIDGET_P_H
6#define DBLUREFFECTWIDGET_P_H
7
8#include <QPainterPath>
9#include <DObjectPrivate>
10#include <DBlurEffectWidget>
11
12DWIDGET_BEGIN_NAMESPACE
13
14class DBlurEffectWidgetPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate
15{
16public:
18
19 DBlurEffectWidget::BlurMode mode = DBlurEffectWidget::GaussianBlur;
20 QImage sourceImage;
21 bool customSourceImage = false;
22 bool autoScaleSourceImage = false;
23 DBlurEffectWidget::BlendMode blendMode = DBlurEffectWidget::InWindowBlend;
24
25 int radius = 35;
26 int blurRectXRadius = 0;
27 int blurRectYRadius = 0;
28 qint16 maskAlpha = -1;
29
30 bool full = false;
31 bool blurEnabled = true;
32
33 QColor maskColor = Qt::transparent;
34 DBlurEffectWidget::MaskColorType maskColorType = DBlurEffectWidget::AutoColor;
35 QPainterPath maskPath;
36
37 // group
38 DBlurEffectGroup *group = nullptr;
39
40 bool isBehindWindowBlendMode() const;
41 bool isFull() const;
42
43 void addToBlurEffectWidgetHash();
44 void removeFromBlurEffectWidgetHash();
45
46 bool updateWindowBlurArea();
47 void setMaskColor(const QColor &color);
48 void setMaskAlpha(const quint8 alpha);
49 quint8 getMaskColorAlpha() const;
50 QColor getMaskColor(const QColor &baseColor) const;
51
52 void resetSourceImage();
53
54 static QMultiHash<QWidget*, const DBlurEffectWidget*> blurEffectWidgetHash;
55 static QHash<const DBlurEffectWidget*, QWidget*> windowOfBlurEffectHash;
56 static bool updateWindowBlurArea(QWidget *topLevelWidget);
57
58private:
59 D_DECLARE_PUBLIC(DBlurEffectWidget)
60};
61
62DWIDGET_END_NAMESPACE
63
64#endif // DBLUREFFECTWIDGET_P_H
Definition dblureffectwidget.h:125
Definition dblureffectwidget_p.h:15
用于实现主窗口或控件背景的实时模糊效果.
Definition dblureffectwidget.h:17
BlendMode
Definition dblureffectwidget.h:41
BlurMode
Definition dblureffectwidget.h:35