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
1149e9ad
Commit
1149e9ad
authored
Nov 30, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ui/modules/Linphone/Chat/Chat): block at each scroll
parent
ceef883d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
23 deletions
+12
-23
ChatProxyModel.cpp
tests/src/components/chat/ChatProxyModel.cpp
+5
-3
ChatProxyModel.hpp
tests/src/components/chat/ChatProxyModel.hpp
+1
-1
Chat.qml
tests/ui/modules/Linphone/Chat/Chat.qml
+6
-19
No files found.
tests/src/components/chat/ChatProxyModel.cpp
View file @
1149e9ad
...
...
@@ -25,7 +25,7 @@ void ChatModelFilter::setEntryTypeFilter (ChatModel::EntryType type) {
// ===================================================================
const
unsigned
int
ChatProxyModel
::
ENTRIES_CHUNK_SIZE
=
25
;
const
unsigned
int
ChatProxyModel
::
ENTRIES_CHUNK_SIZE
=
50
;
ChatProxyModel
::
ChatProxyModel
(
QObject
*
parent
)
:
QSortFilterProxyModel
(
parent
)
{
setSourceModel
(
&
m_chat_model_filter
);
...
...
@@ -43,8 +43,10 @@ void ChatProxyModel::loadMoreEntries () {
invalidateFilter
();
if
(
count
<
rowCount
())
emit
moreEntriesLoaded
();
count
=
rowCount
()
-
count
;
if
(
count
>
0
)
emit
moreEntriesLoaded
(
count
);
}
}
...
...
tests/src/components/chat/ChatProxyModel.hpp
View file @
1149e9ad
...
...
@@ -42,7 +42,7 @@ class ChatProxyModel : public QSortFilterProxyModel {
signals:
void
sipAddressChanged
(
const
QString
&
sipAddress
);
void
moreEntriesLoaded
();
void
moreEntriesLoaded
(
int
n
);
void
entryTypeFilterChanged
(
ChatModel
::
EntryType
type
);
public:
...
...
tests/ui/modules/Linphone/Chat/Chat.qml
View file @
1149e9ad
...
...
@@ -15,10 +15,6 @@ ColumnLayout {
// Can be a model or a proxy chat model.
property
alias
proxyModel
:
chat
.
model
// Set the offset position to load more entries.
// Not a style property.
property
int
_loadMoreEntriesAtPosition
:
25
// -----------------------------------------------------------------
spacing
:
0
...
...
@@ -28,12 +24,10 @@ ColumnLayout {
property
bool
_tryToLoadMoreEntries
:
true
function
_loadMoreEntries
(
force
)
{
if
((
chat
.
visibleArea
.
yPosition
*
chat
.
height
<=
_loadMoreEntriesAtPosition
&&
!
_tryToLoadMoreEntries
)
||
force
)
{
function
_loadMoreEntries
()
{
if
(
atYBeginning
&&
!
_tryToLoadMoreEntries
)
{
_tryToLoadMoreEntries
=
true
positionViewAtIndex
(
0
,
ListView
.
Beginning
)
proxyModel
.
loadMoreEntries
()
}
}
...
...
@@ -189,16 +183,9 @@ ColumnLayout {
}
// Received only if more entries was loaded.
proxyModel
.
moreEntriesLoaded
.
connect
(
function
()
{
if
(
ScrollBar
.
vertical
.
pressed
&&
atYBeginning
)
{
// Use a timeout to not increase call stack.
Utils
.
setTimeout
(
chat
,
0
,
function
()
{
_loadMoreEntries
(
true
)
positionViewAtIndex
(
1
,
ListView
.
Beginning
)
})
}
else
{
proxyModel
.
moreEntriesLoaded
.
connect
(
function
(
n
)
{
positionViewAtIndex
(
n
-
1
,
ListView
.
Beginning
)
_tryToLoadMoreEntries
=
false
}
})
// When the view is changed (for example `Calls` -> `Messages`),
...
...
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