From fc84c4e9e648b22174aa348b1475705b83829d1b Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Fri, 19 Sep 2025 08:33:24 +0000 Subject: [PATCH] sync: from linuxdeepin/dtkdeclarative Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: https://github.com/linuxdeepin/dtkdeclarative/pull/529 --- qt6/src/qml/AlertToolTip.qml | 3 +++ qt6/src/qml/FlowStyle.qml | 7 +++++-- qt6/src/qml/TitleBar.qml | 1 + src/private/dquickcontrolpalette.cpp | 10 +++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/qt6/src/qml/AlertToolTip.qml b/qt6/src/qml/AlertToolTip.qml index 931a0592..224d7722 100644 --- a/qt6/src/qml/AlertToolTip.qml +++ b/qt6/src/qml/AlertToolTip.qml @@ -21,6 +21,9 @@ ToolTip { closePolicy: Popup.NoAutoClose background: FloatingPanel { + radius: DS.Style.alertToolTip.radius + implicitWidth: DS.Style.alertToolTip.width + implicitHeight: DS.Style.alertToolTip.height backgroundColor: DS.Style.alertToolTip.background insideBorderColor: DS.Style.alertToolTip.insideBorder outsideBorderColor: DS.Style.alertToolTip.outsideBorder diff --git a/qt6/src/qml/FlowStyle.qml b/qt6/src/qml/FlowStyle.qml index f4d529ab..5fdb93f7 100644 --- a/qt6/src/qml/FlowStyle.qml +++ b/qt6/src/qml/FlowStyle.qml @@ -449,8 +449,8 @@ QtObject { } property D.Palette placeholderText: D.Palette { - normal: Qt.rgba(0.33, 0.33, 0.33, 0.4) - normalDark: Qt.rgba(1, 1, 1, 0.3) + normal: Qt.rgba(0, 0, 0, 0.7) + normalDark: Qt.rgba(1, 1, 1, 0.7) } } @@ -615,6 +615,9 @@ QtObject { property int connectorHeight: 12 property int verticalPadding: 4 property int horizontalPadding: 10 + property int width: 30 + property int height: 24 + property int radius: 6 property D.Palette text: D.Palette { normal: ("#e15736") diff --git a/qt6/src/qml/TitleBar.qml b/qt6/src/qml/TitleBar.qml index 3b8eda1f..ef6a2354 100644 --- a/qt6/src/qml/TitleBar.qml +++ b/qt6/src/qml/TitleBar.qml @@ -48,6 +48,7 @@ Item { property D.Palette textColor: DS.Style.button.text palette.windowText: D.ColorSelector.textColor + objectName: "ColorSelectorMaster" HoverHandler { id: hoverHandler diff --git a/src/private/dquickcontrolpalette.cpp b/src/private/dquickcontrolpalette.cpp index bf7ca296..62f7355d 100644 --- a/src/private/dquickcontrolpalette.cpp +++ b/src/private/dquickcontrolpalette.cpp @@ -356,7 +356,7 @@ void DQuickControlColorSelector::findAndSetControlParent() bool needUpdateControl = true; bool needUpdateColorFamily = !m_state->familyIsUserSet; do { - if (needUpdateControl && _d_isControlItem(parentItem)) { + if (needUpdateControl && (_d_isControlItem(parentItem) || specialObjectNameItems().contains(parentItem->objectName()))) { needUpdateControl = false; setControl(parentItem); } @@ -467,8 +467,12 @@ void DQuickControlColorSelector::setControl(QQuickItem *newControl) 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("paletteChanged()") != -1) { + connect(m_control, SIGNAL(paletteChanged()), this, SLOT(updateControlTheme())); + } + if (m_control->metaObject()->indexOfSignal("hoveredChanged()") != -1) { + connect(m_control, SIGNAL(hoveredChanged()), this, SLOT(updateControlState())); + } if (m_control->metaObject()->indexOfSignal("pressedChanged()") != -1) { connect(m_control, SIGNAL(pressedChanged()), this, SLOT(updateControlState())); }