MauiKit Controls

linux/blurhelper/windowblur.h
1/*
2 * Copyright (C) 2021 CutefishOS Team.
3 *
4 * Author: cutefish <cutefishos@foxmail.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <QApplication>
23#include <QObject>
24#include <QQmlEngine>
25#include <QQmlParserStatus>
26#include <QRect>
27#include <QWindow>
28#include <QVector>
29
30class WindowBlur : public QObject, public QQmlParserStatus
31{
33 QML_ELEMENT
35
36 Q_PROPERTY(QWindow *view READ view WRITE setView NOTIFY viewChanged)
37 Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
38 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
39 Q_PROPERTY(qreal windowRadius READ windowRadius WRITE setWindowRadius NOTIFY windowRadiusChanged)
40
41public:
42 WindowBlur(QObject *parent = nullptr) noexcept;
43 ~WindowBlur() override;
44
45 void classBegin() override;
46 void componentComplete() override;
47
48 void setView(QWindow *view);
49 QWindow *view() const;
50
51 void setGeometry(const QRect &rect);
52 QRect geometry() const;
53
54 void setEnabled(bool enabled);
55 bool enabled() const;
56
57 void setWindowRadius(qreal radius);
58 qreal windowRadius() const;
59
60private Q_SLOTS:
61 void onViewVisibleChanged(bool);
62
63private:
64 void updateBlur();
65
67 void viewChanged();
68 void enabledChanged();
69 void windowRadiusChanged();
70 void geometryChanged();
71
72private:
73 QWindow *m_view;
74 QRect m_rect;
75 bool m_enabled;
76 qreal m_windowRadius;
77};
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.