diff --git a/src/dquickwindow.cpp b/src/dquickwindow.cpp index 822e15fd..4018cce6 100644 --- a/src/dquickwindow.cpp +++ b/src/dquickwindow.cpp @@ -190,6 +190,12 @@ void DQuickWindowAttachedPrivate::_q_updateClipPath() q->setClipPathByWM(clipPath->path()); } +void DQuickWindowAttachedPrivate::_q_ensurePlatformHandle() +{ + if (explicitEnable && DWindowManagerHelper::instance()->hasNoTitlebar()) + ensurePlatformHandle(); +} + DQuickWindowAttached::DQuickWindowAttached(QWindow *window) : QObject(window) , DObject(*new DQuickWindowAttachedPrivate(window, this)) @@ -490,13 +496,8 @@ void DQuickWindowAttached::setEnabled(bool e) } if (!d->ensurePlatformHandle()) { - QObject::connect(DWindowManagerHelper::instance(), &DWindowManagerHelper::hasNoTitlebarChanged, this, - [this] () { - D_D(DQuickWindowAttached); - if (d->explicitEnable && DWindowManagerHelper::instance()->hasNoTitlebar()) - d->ensurePlatformHandle(); - - }, Qt::UniqueConnection); + QObject::connect(DWindowManagerHelper::instance(), SIGNAL(hasNoTitlebarChanged()), this, SLOT(_q_ensurePlatformHandle()) + , Qt::UniqueConnection); } } diff --git a/src/dquickwindow.h b/src/dquickwindow.h index 2e7b9e77..0b363c60 100644 --- a/src/dquickwindow.h +++ b/src/dquickwindow.h @@ -168,6 +168,7 @@ public Q_SLOTS: D_PRIVATE_SLOT(void _q_onWindowMotifHintsChanged(quint32)) D_PRIVATE_SLOT(void _q_updateBlurAreaForWindow()) D_PRIVATE_SLOT(void _q_updateClipPath()) + D_PRIVATE_SLOT(void _q_ensurePlatformHandle()) friend class DQuickBehindWindowBlur; friend class DQuickBehindWindowBlurPrivate; diff --git a/src/private/dquickcontrolpalette.cpp b/src/private/dquickcontrolpalette.cpp index 31c10908..3ec5da3a 100644 --- a/src/private/dquickcontrolpalette.cpp +++ b/src/private/dquickcontrolpalette.cpp @@ -11,6 +11,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#endif #include #include @@ -427,6 +430,10 @@ void DQuickControlColorSelector::setControl(QQuickItem *newControl) m_control = newControl; if (m_control) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + auto palette = m_control->property("palette").value(); + connect(palette, &QQuickPalette::changed, this, &DQuickControlColorSelector::updateControlTheme); +#endif connect(m_control, SIGNAL(paletteChanged()), this, SLOT(updateControlTheme())); connect(m_control, SIGNAL(hoveredChanged()), this, SLOT(updateControlState())); if (m_control->metaObject()->indexOfSignal("pressedChanged()") != -1) { diff --git a/src/private/dquickwindow_p.h b/src/private/dquickwindow_p.h index c1c765ad..54204adb 100644 --- a/src/private/dquickwindow_p.h +++ b/src/private/dquickwindow_p.h @@ -39,6 +39,7 @@ class DQuickWindowAttachedPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate void updateBlurAreaFor(DQuickBehindWindowBlur *blur); void _q_updateBlurAreaForWindow(); void _q_updateClipPath(); + void _q_ensurePlatformHandle(); QWindow *window = nullptr; DPlatformHandle *handle = nullptr; diff --git a/src/translations/dtkdeclarative.ts b/src/translations/dtkdeclarative.ts index 4f007d05..a15d21aa 100644 --- a/src/translations/dtkdeclarative.ts +++ b/src/translations/dtkdeclarative.ts @@ -12,17 +12,17 @@ AboutDialog - + Version - + Homepage - + Description @@ -59,6 +59,39 @@ + + TextField + + + Copy + + + + + Cut + + + + + Paste + + + + + Select All + + + + + Undo + + + + + Redo + + + ThemeMenu diff --git a/src/translations/dtkdeclarative_zh_CN.ts b/src/translations/dtkdeclarative_zh_CN.ts index 8a82c043..2f1434ad 100644 --- a/src/translations/dtkdeclarative_zh_CN.ts +++ b/src/translations/dtkdeclarative_zh_CN.ts @@ -1,4 +1,6 @@ - + + + AboutAction @@ -10,17 +12,17 @@ AboutDialog - + Version 版本 - + Homepage 主页 - + Description 描述 @@ -57,6 +59,39 @@ 恢复默认 + + TextField + + + Copy + 复制 + + + + Cut + 剪切 + + + + Paste + 粘贴 + + + + Select All + 全选 + + + + Undo + 撤销 + + + + Redo + 重做 + + ThemeMenu @@ -80,4 +115,4 @@ 跟随系统 - \ No newline at end of file +