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
7 changes: 4 additions & 3 deletions qt6/src/qml/ControlGroup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ColumnLayout {
rightInset: inset
topInset: inset
bottomInset: inset
state: "normal"
state: D.DTK.hasAnimation ? "normal" : "hovered"
states: [
State {
name: "normal"
Expand Down Expand Up @@ -108,6 +108,7 @@ ColumnLayout {
sourceSize: Qt.size(36, 36)

Behavior on rotation {
enabled : D.DTK.hasAnimation
NumberAnimation {
duration: root.interval
easing.type: Easing.Linear
Expand All @@ -120,10 +121,10 @@ ColumnLayout {
anchors.fill: parent
hoverEnabled: true
onClicked: root.isExpanded = !root.isExpanded
onPressed: title.state = "pressed"
onPressed: title.state = D.DTK.hasAnimation ? "pressed" : "hovered"
onReleased: title.state = "hovered"
onEntered: title.state = "hovered"
onExited: title.state = "normal"
onExited: title.state = D.DTK.hasAnimation ? "normal" : "hovered"
}
background: Item {
Loader {
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/ControlGroupItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.11
import QtQml.Models 2.11
import org.deepin.dtk 1.0
import org.deepin.dtk 1.0 as D

RowLayout {
id: root
Expand All @@ -21,12 +21,14 @@ RowLayout {
Layout.fillHeight: true

Behavior on y {
enabled : D.DTK.hasAnimation
NumberAnimation {
duration: parent.parent.interval
easing.type: Easing.Linear
}
}
Behavior on opacity {
enabled : D.DTK.hasAnimation
NumberAnimation {
duration: parent.parent.interval
easing.type: Easing.Linear
Expand Down
19 changes: 14 additions & 5 deletions qt6/src/qml/FloatingMessage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ import org.deepin.dtk.style 1.0 as DS
D.FloatingMessageContainer {
id: control

function closeMessage() {
if (D.DTK.hasAnimation) {
floatingPanel.state = "small"
} else {
floatingPanel.animationFinished = true
floatingPanel.state = "normal"
}
}

property Component contentItem: Label {
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
Expand All @@ -23,10 +32,10 @@ D.FloatingMessageContainer {
width: DS.Style.floatingMessage.closeButtonSize
height: DS.Style.floatingMessage.closeButtonSize
}
onClicked: floatingPanel.state = "small"
onClicked: closeMessage()
}

onDelayClose: floatingPanel.state = "small"
onDelayClose: closeMessage()
duration: 4000
panel: FloatingPanel {
id: floatingPanel
Expand All @@ -37,7 +46,7 @@ D.FloatingMessageContainer {
topPadding: 0
bottomPadding: 0
opacity: 0.0
state: "small"
state: D.DTK.hasAnimation ? "small" : "normal"
onAnimationFinishedChanged: (finished) => {
if (floatingPanel.animationFinished === true) {
D.DTK.closeMessage(control)
Expand Down Expand Up @@ -95,12 +104,12 @@ D.FloatingMessageContainer {
}

ParallelAnimation {
running: closeButton.item ? closeButton.item.hovered : false
running: D.DTK.hasAnimation ? (closeButton.item ? closeButton.item.hovered : false) : false
NumberAnimation { target: closeButton; property: "scale"; to: 1.25; duration: 300; easing.type: Easing.InOutQuart }
NumberAnimation { target: closeButton; property: "rotation"; to: 90; duration: 300; easing.type: Easing.InOutQuart }
}
ParallelAnimation {
running: closeButton.item ? !closeButton.item.hovered : false
running: D.DTK.hasAnimation ? (closeButton.item ? !closeButton.item.hovered : false) : false
NumberAnimation { target: closeButton; property: "scale"; to: 1; duration: 300; easing.type: Easing.InOutQuart }
NumberAnimation { target: closeButton; property: "rotation"; to: 0; duration: 300; easing.type: Easing.InOutQuart }
}
Expand Down
2 changes: 1 addition & 1 deletion qt6/src/qml/Menu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ T.Menu {
anchors.right: parent ? parent.right : undefined
anchors.leftMargin: 6
anchors.rightMargin: 6
scale: 0.9
scale: D.DTK.hasAnimation ? 0.9 : 1.0
Comment thread
kegechen marked this conversation as resolved.
property D.Palette backgroundColor: DS.Style.highlightPanel.background
property D.Palette submenuOpenedItemHighlightColor: DS.Style.menu.submenuOpenedItemHighlight
property D.Palette itemHighlightShadowColor: DS.Style.menu.itemHighlightShadow
Expand Down