Skip to content
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
16 changes: 16 additions & 0 deletions qt6/src/qml/BoxPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 17 additions & 8 deletions qt6/src/qml/FlowStyle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,24 @@ 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 {
common: Qt.rgba(230 / 255, 230 / 255, 230 / 255, 1)
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 {
common: Qt.rgba(169 / 255, 169 / 255, 169 / 255, 0.6)
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)
}
}

Expand All @@ -135,27 +135,32 @@ 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 {
common: Qt.rgba(230 / 255, 230 / 255, 230 / 255, 1)
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 {
normal: Qt.rgba(0, 0, 0, 0.05)
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
Expand All @@ -169,16 +174,18 @@ 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 {
normal: Qt.rgba(1, 1, 1, 0.9)
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 {
Expand All @@ -194,6 +201,7 @@ QtObject {
common: ("transparent")
crystal: Qt.rgba(0, 0, 0, 0.05)
}
hoveredDark: ("transparent")
pressed: ("transparent")
}

Expand All @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions qt6/src/qml/private/ButtonPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading