mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 03:53:23 +02:00
chatview: fix scroll to bottom behavior
Change-Id: Ie010f60784400bdb497a10a656ccb953c8c7ac65 GitLab: #1022 GitLab: #1020
This commit is contained in:
parent
34761591c6
commit
a530db8583
2 changed files with 6 additions and 14 deletions
|
@ -31,7 +31,6 @@ import "../../commoncomponents"
|
||||||
JamiListView {
|
JamiListView {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
|
||||||
function getDistanceToBottom() {
|
function getDistanceToBottom() {
|
||||||
const scrollDiff = ScrollBar.vertical.position -
|
const scrollDiff = ScrollBar.vertical.position -
|
||||||
(1.0 - ScrollBar.vertical.size)
|
(1.0 - ScrollBar.vertical.size)
|
||||||
|
@ -169,11 +168,7 @@ JamiListView {
|
||||||
|
|
||||||
topMargin: 12
|
topMargin: 12
|
||||||
spacing: 2
|
spacing: 2
|
||||||
// this offscreen caching is pretty huge
|
|
||||||
// displayMarginEnd may be removed
|
|
||||||
|
|
||||||
displayMarginBeginning: 2048
|
|
||||||
displayMarginEnd: 2048
|
|
||||||
maximumFlickVelocity: 2048
|
maximumFlickVelocity: 2048
|
||||||
verticalLayoutDirection: ListView.BottomToTop
|
verticalLayoutDirection: ListView.BottomToTop
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
@ -238,7 +233,6 @@ JamiListView {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onAtYBeginningChanged: loadMoreMsgsIfNeeded()
|
onAtYBeginningChanged: loadMoreMsgsIfNeeded()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
@ -264,9 +258,9 @@ JamiListView {
|
||||||
anchors.bottom: root.bottom
|
anchors.bottom: root.bottom
|
||||||
anchors.bottomMargin: JamiTheme.chatViewScrollToBottomButtonBottomMargin
|
anchors.bottomMargin: JamiTheme.chatViewScrollToBottomButtonBottomMargin
|
||||||
anchors.horizontalCenter: root.horizontalCenter
|
anchors.horizontalCenter: root.horizontalCenter
|
||||||
|
visible: 1 - verticalScrollBar.position >= verticalScrollBar.size * 2
|
||||||
|
|
||||||
activeStateTrigger: Math.abs(root.contentY) > root.height * 2
|
onClicked: verticalScrollBar.position = 1 - verticalScrollBar.size
|
||||||
onClicked: root.contentY = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
header: Control {
|
header: Control {
|
||||||
|
|
|
@ -29,21 +29,16 @@ import "../../commoncomponents"
|
||||||
Control {
|
Control {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property alias activeStateTrigger: activeState.when
|
|
||||||
signal clicked
|
signal clicked
|
||||||
|
|
||||||
height: jumpToLatestText.contentHeight + 15
|
height: jumpToLatestText.contentHeight + 15
|
||||||
width: jumpToLatestText.contentWidth + arrowDropDown.width + 50
|
width: jumpToLatestText.contentWidth + arrowDropDown.width + 50
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
id: activeState
|
id: activeState
|
||||||
|
|
||||||
name: "active"
|
name: "active"
|
||||||
PropertyChanges {
|
when: root.visible
|
||||||
target: root
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
transitions: [
|
transitions: [
|
||||||
|
@ -53,6 +48,8 @@ Control {
|
||||||
target: root
|
target: root
|
||||||
duration: JamiTheme.shortFadeDuration
|
duration: JamiTheme.shortFadeDuration
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
|
from: 0.0
|
||||||
|
to: 1.0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Transition {
|
Transition {
|
||||||
|
@ -61,6 +58,7 @@ Control {
|
||||||
target: root
|
target: root
|
||||||
duration: JamiTheme.shortFadeDuration
|
duration: JamiTheme.shortFadeDuration
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
|
from: 1.0
|
||||||
to: 0.0
|
to: 0.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue