Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
3fb64ed3
Commit
3fb64ed3
authored
Mar 12, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/modules/Common/View/ScrollableListView): try other solution to scroll to bottom correctly
parent
aeabbb7c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
27 deletions
+54
-27
resources.qrc
linphone-desktop/resources.qrc
+1
-0
ForceScrollBar.qml
linphone-desktop/ui/modules/Common/Misc/ForceScrollBar.qml
+0
-2
ScrollableListView.js
...hone-desktop/ui/modules/Common/View/ScrollableListView.js
+13
-0
ScrollableListView.qml
...one-desktop/ui/modules/Common/View/ScrollableListView.qml
+36
-6
Chat.js
linphone-desktop/ui/modules/Linphone/Chat/Chat.js
+1
-17
Chat.qml
linphone-desktop/ui/modules/Linphone/Chat/Chat.qml
+0
-1
Home.qml
linphone-desktop/ui/views/App/Main/Home.qml
+3
-1
No files found.
linphone-desktop/resources.qrc
View file @
3fb64ed3
...
...
@@ -262,6 +262,7 @@
<file>
ui/modules/Common/Styles/Tooltip/TooltipStyle.qml
</file>
<file>
ui/modules/Common/Tooltip/TooltipArea.qml
</file>
<file>
ui/modules/Common/Tooltip/Tooltip.qml
</file>
<file>
ui/modules/Common/View/ScrollableListView.js
</file>
<file>
ui/modules/Common/View/ScrollableListView.qml
</file>
<file>
ui/modules/Linphone/Account/AccountStatus.qml
</file>
<file>
ui/modules/Linphone/Calls/CallControls.qml
</file>
...
...
linphone-desktop/ui/modules/Common/Misc/ForceScrollBar.qml
View file @
3fb64ed3
...
...
@@ -26,6 +26,4 @@ ScrollBar {
radius
:
ForceScrollBarStyle
.
contentItem
.
radius
}
hoverEnabled
:
true
visible
:
size
<
1.0
}
linphone-desktop/ui/modules/Common/View/ScrollableListView.js
0 → 100644
View file @
3fb64ed3
// =============================================================================
// `ScrollableListView.qml` Logic.
// =============================================================================
function
positionViewAtEnd
()
{
view
.
interactive
=
false
scrollAnimation
.
start
()
view
.
interactive
=
true
}
function
getYEnd
()
{
return
view
.
originY
+
view
.
contentHeight
-
view
.
height
}
linphone-desktop/ui/modules/Common/View/ScrollableListView.qml
View file @
3fb64ed3
...
...
@@ -3,25 +3,55 @@ import QtQuick.Controls 2.0
import
Common
1.0
import
'
ScrollableListView.js
'
as
Logic
// =============================================================================
ListView
{
id
:
listV
iew
id
:
v
iew
ScrollBar.horizontal
:
ForceScrollBar
{
id
:
hScrollBar
// ---------------------------------------------------------------------------
onPressedChanged
:
pressed
?
listView
.
movementStarted
()
:
listView
.
movementEnded
()
function
positionViewAtEnd
()
{
Logic
.
positionViewAtEnd
()
}
// ---------------------------------------------------------------------------
ScrollBar.vertical
:
ForceScrollBar
{
id
:
vScrollBar
onPressedChanged
:
pressed
?
listView
.
movementStarted
()
:
listV
iew
.
movementEnded
()
onPressedChanged
:
pressed
?
view
.
movementStarted
()
:
v
iew
.
movementEnded
()
}
// ---------------------------------------------------------------------------
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
contentWidth
:
vScrollBar
.
visible
?
width
-
vScrollBar
.
width
:
width
contentWidth
:
width
-
vScrollBar
.
width
spacing
:
0
// ---------------------------------------------------------------------------
SequentialAnimation
{
id
:
scrollAnimation
ScriptAction
{
script
:
{
view
.
contentY
=
view
.
contentY
view
.
contentY
=
Logic
.
getYEnd
()
view
.
contentY
=
view
.
contentY
}
}
PauseAnimation
{
duration
:
200
}
ScriptAction
{
script
:
{
view
.
contentY
=
Logic
.
getYEnd
()
}
}
}
}
linphone-desktop/ui/modules/Linphone/Chat/Chat.js
View file @
3fb64ed3
...
...
@@ -28,22 +28,6 @@ function getComponentFromEntry (chatEntry) {
return
chatEntry
.
isOutgoing
?
'
OutgoingMessage.qml
'
:
'
IncomingMessage.qml
'
}
function
handleCurrentItemChanged
(
currentItem
)
{
// Go to last item only!
if
(
!
chat
.
bindToEnd
||
!
currentItem
||
chat
.
currentIndex
+
1
!==
chat
.
count
)
{
return
}
var
chatHeight
=
chat
.
height
var
messageY
=
currentItem
.
mapToItem
(
chat
.
contentItem
,
0
,
0
).
y
var
messageHeight
=
currentItem
.
height
console
.
log
(
chat
.
contentY
,
chatHeight
,
messageY
)
if
(
chat
.
contentY
<=
messageY
)
{
chat
.
contentY
=
messageY
}
chat
.
currentIndex
=
-
1
}
function
handleFilesDropped
(
files
)
{
chat
.
bindToEnd
=
true
files
.
forEach
(
proxyModel
.
sendFileMessage
)
...
...
@@ -69,7 +53,7 @@ function handleDataChanged (_, bottomRight) {
var
index
=
bottomRight
.
row
if
(
chat
.
bindToEnd
&&
index
+
1
===
n
)
{
chat
.
currentIndex
=
index
chat
.
positionViewAtEnd
()
}
}
...
...
linphone-desktop/ui/modules/Linphone/Chat/Chat.qml
View file @
3fb64ed3
...
...
@@ -52,7 +52,6 @@ Rectangle {
Component.onCompleted
:
Logic
.
initView
()
onContentYChanged
:
Logic
.
loadMoreEntries
()
onCurrentItemChanged
:
Logic
.
handleCurrentItemChanged
(
currentItem
)
onMovementEnded
:
Logic
.
handleMovementEnded
()
onMovementStarted
:
Logic
.
handleMovementStarted
()
...
...
linphone-desktop/ui/views/App/Main/Home.qml
View file @
3fb64ed3
...
...
@@ -12,8 +12,10 @@ import App.Styles 1.0
Rectangle
{
color
:
HomeStyle
.
color
Scrollable
ListView
{
ListView
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
orientation
:
ListView
.
Horizontal
spacing
:
HomeStyle
.
spacing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment