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
67 changes: 64 additions & 3 deletions qt6/src/qml/FloatingMessage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ D.FloatingMessageContainer {
width: DS.Style.floatingMessage.closeButtonSize
height: DS.Style.floatingMessage.closeButtonSize
}
onClicked: D.DTK.closeMessage(control)
onClicked: {
floatingPanel.state = "small"
destroyTimer.running = true
}
Timer {
id: destroyTimer
interval: 1200; running: false; repeat: true
onTriggered: D.DTK.closeMessage(control)
}
}


duration: 4000
panel: FloatingPanel {
id: floatingPanel
Expand All @@ -34,12 +43,24 @@ D.FloatingMessageContainer {
rightPadding: 10
topPadding: 0
bottomPadding: 0

opacity: 0.0
state: "small"
Timer {
id: timer
interval: 100; running: false; repeat: false
onTriggered: {
floatingPanel.y = floatingPanel.parent.height
floatingPanel.state = "normal"
console.log("onCompleted", floatingPanel.y, floatingPanel.parent.width, floatingPanel.parent.height)
}
}
Component.onCompleted: {
timer.running = true
}
contentItem: RowLayout {
height: DS.Style.floatingMessage.minimumHeight
width: Math.min(DS.Style.floatingMessage.maximumWidth, children.width + floatingPanel.leftPadding - floatingPanel.rightPadding)
spacing: 10

Loader {
id: iconLoader
Layout.alignment: Qt.AlignVCenter
Expand Down Expand Up @@ -77,6 +98,46 @@ D.FloatingMessageContainer {
visible: active
sourceComponent: button
}

ParallelAnimation {
running: closeButton.item.hovered
NumberAnimation { target: closeButton; property: "scale"; to: 1.25; duration: 500 }
NumberAnimation { target: closeButton; property: "rotation"; to: 90; duration: 500 }
}
ParallelAnimation {
running: !closeButton.item.hovered
NumberAnimation { target: closeButton; property: "scale"; to: 1; duration: 500 }
NumberAnimation { target: closeButton; property: "rotation"; to: 0; duration: 500 }
}
}

states: [
State {
name: "normal"
PropertyChanges {
target: floatingPanel
y: 0
opacity: 1.0
scale: 1.0
}
},
State {
name: "small"
PropertyChanges {
target: floatingPanel
y: floatingPanel.parent.height
opacity: 0.0
scale: 0.2
}
}
]

transitions: Transition {
NumberAnimation {
properties: "y, opacity, scale"
easing.type: Easing.Linear
duration: 1000
}
}
}
}
6 changes: 5 additions & 1 deletion src/private/dmessagemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,15 @@ void MessageManager::ensureLayout()
QQmlComponent columnCom(qmlEngine(parent()));
columnCom.setData("import QtQuick 2.11\n"
"Column {\n"
" spacing: 0\n"
" anchors {\n"
" bottom: parent.bottom\n"
" bottomMargin: 10;\n"
" bottomMargin: 20;\n"
" horizontalCenter: parent.horizontalCenter\n"
" }\n"
" Component.onCompleted: {\n"
" console.log(\"parent onCompleted\", children.length);\n"
" }"
"}\n", QUrl());
auto layout = columnCom.beginCreate(qmlContext(parent()));
setLayout(qobject_cast<QQuickItem *>(layout));
Expand Down