RibbonMessageBarGroup: Improve animation and only allow handler visible when message's count large than 1.

This commit is contained in:
Mentalflow 2024-08-13 18:38:39 +08:00
parent 10cb6a248c
commit 7015bab1b6
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
2 changed files with 4 additions and 4 deletions

View File

@ -119,7 +119,7 @@ RibbonBlur {
add: Transition { add: Transition {
NumberAnimation { NumberAnimation {
properties: "y" properties: "y"
from: message_list.height from: -message_list.height
duration: control.animationTime duration: control.animationTime
} }
} }
@ -157,7 +157,7 @@ RibbonBlur {
y: message_list.y + message_list.height * (folded ? 1 : 0) y: message_list.y + message_list.height * (folded ? 1 : 0)
implicitHeight: folded ? 10 : 20 implicitHeight: folded ? 10 : 20
implicitWidth: parent.width implicitWidth: parent.width
visible: hover.hovered && messageModel.count visible: hover.hovered && messageModel.count > 1
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5) color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {

View File

@ -119,7 +119,7 @@ RibbonBlur {
add: Transition { add: Transition {
NumberAnimation { NumberAnimation {
properties: "y" properties: "y"
from: message_list.height from: -message_list.height
duration: control.animationTime duration: control.animationTime
} }
} }
@ -157,7 +157,7 @@ RibbonBlur {
y: message_list.y + message_list.height * (folded ? 1 : 0) y: message_list.y + message_list.height * (folded ? 1 : 0)
implicitHeight: folded ? 10 : 20 implicitHeight: folded ? 10 : 20
implicitWidth: parent.width implicitWidth: parent.width
visible: hover.hovered && messageModel.count visible: hover.hovered && messageModel.count > 1
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5) color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {