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
12 changes: 6 additions & 6 deletions qt6/src/qml/ButtonBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ Control {

ParallelAnimation {
running: btnGroup.checkedButton && (btnGroup.checkedButton.x !== backgroundPanel.x || btnGroup.checkedButton.y !== backgroundPanel.y)
NumberAnimation { target: backgroundPanel; property: "x"; to: btnGroup.checkedButton.x; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "y"; to: btnGroup.checkedButton.y; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "width"; to: btnGroup.checkedButton.width; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "height"; to: btnGroup.checkedButton.height; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "x"; to: btnGroup.checkedButton ? btnGroup.checkedButton.x : backgroundPanel.x; duration: 200 }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不会有循环绑定么?当btnGroup.checkedButton为null时, target: backgroundPanel的x 被赋值为 backgroundPanel.x,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不会

NumberAnimation { target: backgroundPanel; property: "y"; to: btnGroup.checkedButton ? btnGroup.checkedButton.y : backgroundPanel.y; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "width"; to: btnGroup.checkedButton ? btnGroup.checkedButton.width : backgroundPanel.width; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "height"; to: btnGroup.checkedButton ? btnGroup.checkedButton.height : backgroundPanel.height; duration: 200 }
}

P.ButtonPanel {
id: backgroundPanel
visible: btnGroup.checkedButton
implicitWidth: btnGroup.checkedButton.width
implicitHeight: btnGroup.checkedButton.height
implicitWidth: visible ? btnGroup.checkedButton.width : 0
implicitHeight: visible ? btnGroup.checkedButton.height : 0
button: control
outsideBorderColor: null
color1: D.Palette {
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/DragItemsImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ Item {
if (!item)
return

// item.dragActive = true
img.width = item.width
img.height = item.height

aboutToGrabToImage(item)
item.grabToImage(function(result) {
img.source = result.url
Expand Down
11 changes: 11 additions & 0 deletions qt6/src/qml/ListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,19 @@ ListView {
active: hoveredItem
sourceComponent: P.ButtonPanel {
button: hoveredItem
enableAnimation: false // avoid hover animation
outsideBorderColor: null
insideBorderColor: null
visible: hoveredItem && !hoveredItem.checked && hoveredItem.enabled
color1: D.Palette {
normal {
common: Qt.rgba(0, 0, 0, 0.1)
}
normalDark {
common: Qt.rgba(1, 1, 1, 0.1)
}
}
color2: color1
}
}

Expand Down
4 changes: 2 additions & 2 deletions qt6/src/qml/private/ButtonPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ BoxPanel {
id: control
property Item button

property bool enableAnimation: control.D.ColorSelector.controlState === D.DTK.HoveredState && control.D.ColorSelector.family === D.Palette.CommonColor
color1: selectValue(DS.Style.button.background1, DS.Style.checkedButton.background, DS.Style.highlightedButton.background1)
color2: selectValue(DS.Style.button.background2, DS.Style.checkedButton.background, DS.Style.highlightedButton.background2)
insideBorderColor: selectValue(DS.Style.button.insideBorder, null, DS.Style.highlightedButton.border)
Expand Down Expand Up @@ -52,8 +53,7 @@ BoxPanel {
CicleSpreadAnimation {
id: hoverAnimation
anchors.fill: parent
visible: control.D.ColorSelector.controlState === D.DTK.HoveredState
&& control.D.ColorSelector.family === D.Palette.CommonColor
visible: enableAnimation

Rectangle {
anchors.fill: parent
Expand Down