Skip to content
This repository was archived by the owner on Jul 15, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions qmlplugin/qmlplugin_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ inline void dtkRegisterTypeAlias(const char *uri1, const char *uri2, int version
qmlRegisterType(url, uri2, versionMajor, versionMinor, alias);
}

inline void dtkRegisterTypeOverridable(const char *uri1, const char *uri2, int versionMajor, int versionMinor, const char *qmlFileName) {
dtkRegisterTypeAlias(uri1, uri2, versionMajor, versionMinor, qmlFileName, qmlFileName, "overridable/");
}

inline void dtkStyleRegisterSingletonType(const char *uri1, const char *uri2, int versionMajor, int versionMinor, const char *qmlName) {
static QString urlTemplate = QStringLiteral("qrc:/dtk/declarative/qml/style/%1.qml");
QUrl url(urlTemplate.arg(qmlName));
Expand Down Expand Up @@ -152,6 +156,7 @@ void QmlpluginPlugin::registerTypes(const char *uri)
qmlRegisterModule(styleUri.constData(), 1, 0);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QByteArray implUri;
dtkRegisterTypeOverridable(uri, nullptr, 1, 0, "InWindowBlur");
#else
// @uri org.deepin.dtk.impl
const QByteArray implUri = QByteArray(uri).append(".impl");
Expand Down
2 changes: 1 addition & 1 deletion qt6/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PRIVATE
${LIB_NAME}_sources
)

file(GLOB QML_RCS dtkdeclarative_qml.qrc)
file(GLOB QML_RCS dtkdeclarative_qml.qrc dtkdeclarative_overridable_qml.qrc)
qt_add_resources(RESOURCES
${QML_RCS}
${ASSETS_RCS}
Expand Down
5 changes: 5 additions & 0 deletions qt6/src/dtkdeclarative_overridable_qml.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/dtk/declarative">
<file>qml/overridable/InWindowBlur.qml</file>
</qresource>
</RCC>
3 changes: 2 additions & 1 deletion qt6/src/qml/FloatingPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Control {
property int blurRadius: DS.Style.floatingPanel.radius

background: D.InWindowBlur {
id: blur
implicitWidth: DS.Style.floatingPanel.width
implicitHeight: DS.Style.floatingPanel.height
radius: blurRadius
Expand All @@ -29,7 +30,7 @@ Control {
D.ItemViewport {
anchors.fill: parent
fixed: true
sourceItem: parent
sourceItem: blur.content
radius: control.radius
hideSource: false
}
Expand Down
11 changes: 11 additions & 0 deletions qt6/src/qml/overridable/InWindowBlur.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import QtQuick 2.11
import org.deepin.dtk 1.0 as D

D.InWindowBlurImpl {
id: control
readonly property Item content: control
}
2 changes: 1 addition & 1 deletion src/private/dquickinwindowblur_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DQuickInWindowBlur : public QQuickItem
Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
Q_PROPERTY(bool offscreen READ offscreen WRITE setOffscreen NOTIFY offscreenChanged)
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QML_NAMED_ELEMENT(InWindowBlur)
QML_NAMED_ELEMENT(InWindowBlurImpl)
#endif

public:
Expand Down