HListView component with animations

This commit is contained in:
miruka 2019-05-13 13:15:03 -04:00
parent 4024eee460
commit 2da7214af1
8 changed files with 39 additions and 7 deletions

View File

@ -318,8 +318,9 @@ class SignalManager(QObject):
if not event.isLocalEcho: if not event.isLocalEcho:
continue continue
sb = (event.dict["sender"], event.dict["body"]) sb = (event.dict.get("sender"), event.dict.get("body"))
new_sb = (new_event.dict["sender"], new_event.dict["body"]) new_sb = (new_event.dict.get("sender"),
new_event.dict.get("body"))
if sb == new_sb: if sb == new_sb:
# The oldest matching local echo shall be replaced # The oldest matching local echo shall be replaced

View File

@ -0,0 +1,28 @@
import QtQuick 2.7
ListView {
property int duration: HStyle.animationDurations
add: Transition {
NumberAnimation { properties: "x,y"; from: 100; duration: duration }
}
populate: Transition {
NumberAnimation { properties: "x,y"; duration: duration }
}
move: Transition {
NumberAnimation { properties: "x,y"; duration: duration }
}
displaced: Transition {
NumberAnimation { properties: "x,y"; duration: duration }
}
remove: Transition {
ParallelAnimation {
NumberAnimation { property: "opacity"; to: 0; duration: duration }
NumberAnimation { properties: "x,y"; to: 100; duration: duration }
}
}
}

View File

@ -4,6 +4,8 @@ import QtQuick 2.7
QtObject { QtObject {
id: style id: style
property int animationDurations: 120
readonly property QtObject fontSize: QtObject { readonly property QtObject fontSize: QtObject {
property int smallest: 6 property int smallest: 6
property int smaller: 8 property int smaller: 8

View File

@ -6,7 +6,7 @@ HRectangle {
color: HStyle.chat.roomEventList.background color: HStyle.chat.roomEventList.background
ListView { HListView {
id: roomEventListView id: roomEventListView
delegate: RoomEventDelegate {} delegate: RoomEventDelegate {}
model: Backend.roomEvents.get(chatPage.roomId) model: Backend.roomEvents.get(chatPage.roomId)

View File

@ -8,7 +8,7 @@ HColumnLayout {
Layout.leftMargin: roomSidePane.collapsed ? 0 : normalSpacing Layout.leftMargin: roomSidePane.collapsed ? 0 : normalSpacing
Layout.rightMargin: Layout.leftMargin Layout.rightMargin: Layout.leftMargin
ListView { HListView {
id: memberList id: memberList
spacing: parent.Layout.leftMargin spacing: parent.Layout.leftMargin

View File

@ -1,7 +1,8 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import "../Base"
ListView { HListView {
id: accountList id: accountList
clip: true clip: true

View File

@ -2,7 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import "../Base" import "../Base"
ListView { HListView {
property string userId: "" property string userId: ""
id: roomCategoriesList id: roomCategoriesList

View File

@ -2,7 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import "../Base" import "../Base"
ListView { HListView {
property string userId: "" property string userId: ""
property string category: "" property string category: ""