diff --git a/qt6/src/qml/BoxPanel.qml b/qt6/src/qml/BoxPanel.qml index 9c4fae45..40b1dded 100644 --- a/qt6/src/qml/BoxPanel.qml +++ b/qt6/src/qml/BoxPanel.qml @@ -66,6 +66,22 @@ Item { antialiasing: false } + // Soft drop shadow (blur > 0): uses BoxShadow for blurred rendering. + // Active only when boxShadowBlur is non-zero (e.g. pressed state). + Loader { + active: control.enableBoxShadow && control.enableDropShadow + && control.boxShadowBlur > 0 + && dropShadowColor && control.D.ColorSelector.dropShadowColor.a > 0 + anchors.fill: parent + + sourceComponent: BoxShadow { + cornerRadius: backgroundRect.radius + shadowBlur: control.boxShadowBlur + shadowOffsetY: control.boxShadowOffsetY + shadowColor: control.D.ColorSelector.dropShadowColor + } + } + Rectangle { id: backgroundRect property alias color1: control.color1 diff --git a/qt6/src/qml/FlowStyle.qml b/qt6/src/qml/FlowStyle.qml index 8df21147..1535a1ed 100644 --- a/qt6/src/qml/FlowStyle.qml +++ b/qt6/src/qml/FlowStyle.qml @@ -108,7 +108,7 @@ QtObject { crystal: Qt.rgba(0, 0, 0, 0.1) } normalDark { - common: Qt.rgba(60 / 255, 60 / 255, 60 / 255, 1) + common: Qt.rgba(60 / 255, 60 / 255, 60 / 255, 0.6) crystal: Qt.rgba(1, 1, 1, 0.08) } hovered { @@ -116,7 +116,7 @@ QtObject { crystal: Qt.rgba(0, 0, 0, 0.2) } hoveredDark { - common: Qt.rgba(110 / 255, 110 / 255, 110 / 255, 0.6) + common: Qt.rgba(110 / 255, 110 / 255, 110 / 255, 0.4) crystal: Qt.rgba(1, 1, 1, 0.2) } pressed { @@ -124,8 +124,8 @@ QtObject { crystal: Qt.rgba(0, 0, 0, 0.15) } pressedDark { - common: Qt.rgba(1, 1, 1, 0.05) - crystal: Qt.rgba(1, 1, 1, 0.05) + common: Qt.rgba(40 / 255, 40 / 255, 40 / 255, 1) + crystal: Qt.rgba(40 / 255, 40 / 255, 40 / 255, 1) } } @@ -135,7 +135,7 @@ QtObject { crystal: Qt.rgba(0, 0, 0, 0.1) } normalDark { - common: Qt.rgba(45 / 255, 45 / 255, 45 / 255, 1) + common: Qt.rgba(45 / 255, 45 / 255, 45 / 255, 0.6) crystal: Qt.rgba(1, 1, 1, 0.1) } hovered { @@ -143,12 +143,16 @@ QtObject { crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.2) } hoveredDark { - common: Qt.rgba(66 / 255, 66 / 255, 66 / 255, 0.6) + common: Qt.rgba(66 / 255, 66 / 255, 66 / 255, 0.4) } pressed { common: Qt.rgba(202 / 255, 202 / 255, 202 / 255, 0.5) crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.15) } + pressedDark { + common: Qt.rgba(40 / 255, 40 / 255, 40 / 255, 1) + crystal: Qt.rgba(46 / 255, 46 / 255, 46 / 255, 1) + } } property D.Palette dropShadow: D.Palette { @@ -156,6 +160,7 @@ QtObject { normalDark: ("transparent") hovered: Qt.rgba(0, 0, 0, 0.05) pressed: Qt.rgba(0, 0, 0, 0.1) + pressedDark: Qt.rgba(0, 0, 0, 0.4) } // 1px near hard drop shadow layered over `dropShadow` (the 2px far @@ -169,9 +174,10 @@ QtObject { property D.Palette innerShadow1: D.Palette { normal: ("transparent") - normalDark: Qt.rgba(0, 0, 0, 0.5) - hoveredDark: Qt.rgba(0, 0, 0, 0.6) + normalDark: Qt.rgba(0, 0, 0, 0.2) + hoveredDark: Qt.rgba(0, 0, 0, 0.3) pressed: ("transparent") + pressedDark: ("transparent") } property D.Palette innerShadow2: D.Palette { @@ -179,6 +185,7 @@ QtObject { normalDark: Qt.rgba(1, 1, 1, 0.07) hovered: Qt.rgba(1, 1, 1, 0.3) pressed: ("transparent") + pressedDark: Qt.rgba(1, 1, 1, 0.07) } property D.Palette insideBorder: D.Palette { @@ -194,6 +201,7 @@ QtObject { common: ("transparent") crystal: Qt.rgba(0, 0, 0, 0.05) } + hoveredDark: ("transparent") pressed: ("transparent") } @@ -210,6 +218,7 @@ QtObject { crystal: Qt.rgba(0, 0, 0, 0.2) } pressed: Qt.rgba(0, 0, 0, 0.15) + pressedDark: ("transparent") } property D.Palette text: D.Palette { diff --git a/qt6/src/qml/private/ButtonPanel.qml b/qt6/src/qml/private/ButtonPanel.qml index 6daca548..11a6f404 100644 --- a/qt6/src/qml/private/ButtonPanel.qml +++ b/qt6/src/qml/private/ButtonPanel.qml @@ -20,9 +20,10 @@ BoxPanel { dropShadowColor2: selectValue(DS.Style.button.dropShadow2, null, null) innerShadowColor1: selectValue(DS.Style.button.innerShadow1, DS.Style.checkedButton.innerShadow, DS.Style.highlightedButton.innerShadow1) innerShadowColor2: selectValue(DS.Style.button.innerShadow2, null, DS.Style.highlightedButton.innerShadow2) - // All states use hard shadows (blur=0). Normal/hover: 2px far shadow + - // 1px near shadow layered on top. Pressed: 1px only (CSS `0 1px 0 0`). - boxShadowBlur: selectValue(0, 6, 4) + // Normal/hover: hard shadows (blur=0) - 2px far shadow + 1px near + // shadow layered on top. Pressed: soft shadow (blur=1) via BoxShadow, + // offset 1px down. + boxShadowBlur: selectValue(control.D.ColorSelector.controlState === D.DTK.PressedState ? 1 : 0, 6, 4) boxShadowOffsetY: selectValue(control.D.ColorSelector.controlState === D.DTK.PressedState ? 1 : 2, 4, 4) boxShadowOffsetY2: selectValue(control.D.ColorSelector.controlState === D.DTK.PressedState ? 0 : 1, 0, 0) innerShadowOffsetY1: -1