Skip to content

Commit 581a0bb

Browse files
add-uosdeepin-bot[bot]
authored andcommitted
fix(dialog): improve DialogWindow blur effect with proper color handling
Set color to transparent when enableBlurWindow is true to properly render blur effect. Add StyledBehindWindowBlur component and adjust title bar blend settings. 当启用窗口模糊时,将颜色设为透明以正确渲染模糊效果。添加窗口背景模糊组件并调整标题栏混合设置。 Log: 优化DialogWindow窗口模糊效果,颜色自动适配透明设置 PMS: BUG-316567 Influence: 使用模糊窗口的对话框不再需要手动设置color为transparent,由框架自动处理。同时新增StyledBehindWindowBlur组件提供更好的背景模糊视觉效果。
1 parent 122ea37 commit 581a0bb

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

qt6/src/qml/DialogWindow.qml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Window {
2222
D.DWindow.enableBlurWindow: true
2323
flags: Qt.Dialog | Qt.WindowCloseButtonHint | Qt.MSWindowsFixedSizeDialogHint
2424
D.ColorSelector.family: D.Palette.CrystalColor
25-
color: active ? D.DTK.palette.window : D.DTK.inactivePalette.window
25+
color: D.DWindow.enableBlurWindow ? "transparent" : (active ? D.DTK.palette.window : D.DTK.inactivePalette.window)
2626
height: content.height
2727
width: content.width
2828

@@ -32,6 +32,21 @@ Window {
3232
property alias palette : content.palette
3333
property real leftPadding: DS.Style.dialogWindow.contentHMargin
3434
property real rightPadding: DS.Style.dialogWindow.contentHMargin
35+
36+
D.StyledBehindWindowBlur {
37+
control: control
38+
anchors.fill: parent
39+
blendColor: {
40+
if (valid) {
41+
return DS.Style.control.selectColor(undefined,
42+
Qt.rgba(235 / 255.0, 235 / 255.0, 235 / 255.0, 0.6),
43+
Qt.rgba(10 / 255.0, 10 / 255.0, 10 / 255.0, 85 / 255.0))
44+
}
45+
return DS.Style.control.selectColor(undefined,
46+
DS.Style.behindWindowBlur.lightNoBlurColor,
47+
DS.Style.behindWindowBlur.darkNoBlurColor)
48+
}
49+
}
3550

3651
Item {
3752
id: content
@@ -45,7 +60,7 @@ Window {
4560
id: titleBar
4661
z: D.DTK.TopOrder
4762
sourceComponent: DialogTitleBar {
48-
enableInWindowBlendBlur: true
63+
enableInWindowBlendBlur: false
4964
icon.name: control.icon
5065
title: control.title
5166
}
@@ -60,7 +75,7 @@ Window {
6075
}
6176
}
6277
}
63-
78+
6479
onClosing: function(close) {
6580
// close can't reset sub control's hovered state. pms Bug:168405
6681
// if we need to close, we can add closing handler to set `close.acceped = true`

0 commit comments

Comments
 (0)