diff --git a/qt6/src/qml/ArrowListView.qml b/qt6/src/qml/ArrowListView.qml index eb7c880c2..e3f764fe4 100644 --- a/qt6/src/qml/ArrowListView.qml +++ b/qt6/src/qml/ArrowListView.qml @@ -60,10 +60,9 @@ FocusScope { } interactive: itemsView.count > maxVisibleItems ScrollIndicator.vertical: ScrollIndicator { } - highlight: HighlightPanel { + highlight: Control { visible: false // TODO listview's highlight is confict with Item's highlight. - outerShadowColor: null - innerShadowColor: null + hoverEnabled: false scale: D.DTK.hasAnimation ? 0.9 : 1.0 Component.onCompleted: { scale = 1.0 @@ -71,6 +70,13 @@ FocusScope { Behavior on scale { NumberAnimation { duration: 100 } } + + // Keep the highlight panel under a Control so that its + // ColorSelector can resolve typed colors (e.g. D.Color.Highlight). + contentItem: HighlightPanel { + outerShadowColor: null + innerShadowColor: null + } } highlightFollowsCurrentItem: true highlightMoveDuration: -1 diff --git a/qt6/src/qml/Menu.qml b/qt6/src/qml/Menu.qml index b3a07729b..885498602 100644 --- a/qt6/src/qml/Menu.qml +++ b/qt6/src/qml/Menu.qml @@ -68,24 +68,30 @@ T.Menu { view.highlightMoveDuration: 50 view.highlightMoveVelocity: -1 - view.highlight: HighlightPanel { - id: highlightRect + view.highlight: Control { visible: false // TODO listview's highlight is confict with Item's highlight. + hoverEnabled: false anchors.left: parent ? parent.left : undefined anchors.right: parent ? parent.right : undefined anchors.leftMargin: 0 anchors.rightMargin: 0 scale: D.DTK.hasAnimation ? 0.9 : 1.0 - radius: DS.Style.menu.item.radius - outerShadowColor: null - innerShadowColor: null Component.onCompleted: { scale = 1.0 } Behavior on scale { NumberAnimation { duration: 100 } } + + // Keep the highlight panel under a Control so that its + // ColorSelector can resolve typed colors (e.g. D.Color.Highlight). + contentItem: HighlightPanel { + id: highlightRect + radius: DS.Style.menu.item.radius + outerShadowColor: null + innerShadowColor: null + } } } Loader { diff --git a/src/private/dquickcontrolpalette.cpp b/src/private/dquickcontrolpalette.cpp index a8ea3dcc0..a1ee2bc58 100644 --- a/src/private/dquickcontrolpalette.cpp +++ b/src/private/dquickcontrolpalette.cpp @@ -840,6 +840,11 @@ QColor DQuickControlColorSelector::getColorOf(const DQuickControlPalette *palett if (targetColor.isTypedColor()) { if (m_control) colorValue = targetColor.toColor(_d_getControlPalette(m_control)); + else + // no control in the parent chain (e.g. popup/window context): + // fall back to the application-wide standard palette instead of + // returning an invalid color + colorValue = targetColor.toColor(DGuiApplicationHelper::standardPalette(state->controlTheme)); } else { colorValue = targetColor.color(); }