diff --git a/linphone-app/ui/modules/Common/View/ScrollableListView.qml b/linphone-app/ui/modules/Common/View/ScrollableListView.qml index cbdabd5ba..9cd4e26d8 100644 --- a/linphone-app/ui/modules/Common/View/ScrollableListView.qml +++ b/linphone-app/ui/modules/Common/View/ScrollableListView.qml @@ -13,30 +13,7 @@ ListView { property bool fitCacheToContent: true property bool bindToEnd: false - - function getVisibleIndex(checkMax) { - var center_x = view.x + view.width / 2 - var index = -1 - var yCheck = 0 - var direction = checkMax ? -1 : 1 - var yStart = view.y + view.contentY + (checkMax ? view.height : 0) - var yStep = 5 - while(index<0 && yCheck < view.height){ - index = indexAt( center_x, yStart + yCheck * direction) - yCheck += yStep - } - return index - } - function getVisibleIndexRange() { - return [getVisibleIndex(0), getVisibleIndex(1)] - } - function isIndexVisible(index){ - return getVisibleIndex(0) <= index && index <= getVisibleIndex(1) - } - function isIndexAfter(index){ - return getVisibleIndex(1) < index - } - + property bool endIsDisplayed: !vScrollBar.visible ||( vScrollBar.visualPosition + vScrollBar.visualSize) >= 1.0 // --------------------------------------------------------------------------- ScrollBar.vertical: ForceScrollBar { diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.qml b/linphone-app/ui/modules/Linphone/Chat/Chat.qml index 1d3e199b0..e371c10ba 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.qml @@ -313,7 +313,7 @@ Rectangle { anchors.bottomMargin: 10 anchors.right: parent.right anchors.rightMargin: 35 - visible: chat.isIndexAfter(chat.count-1) + visible: !chat.endIsDisplayed onVisibleChanged: updateMarkAsRead() Component.onCompleted: updateMarkAsRead() function updateMarkAsRead(){