Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstreaming coderus fixies #108

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Open dialog at last unread message
Fixes #2
CODeRUS committed Mar 1, 2017
commit 55c20df2dbe1973f09cd9517ec44172bb2dfbf61
17 changes: 15 additions & 2 deletions harbour-sailorgram/qml/components/message/MessagesList.qml
Original file line number Diff line number Diff line change
@@ -27,6 +27,21 @@ SilicaListView
return selectionlist;
}

onCountChanged: {
if (model.newMessageIndex >= 0 && model.newMessageIndex < count) {
positionViewAtIndex(model.newMessageIndex, ListView.Center);
}
}

Connections {
target: model
onNewMessageIndexChanged: {
if (model.newMessageIndex >= 0 && model.newMessageIndex < count) {
positionViewAtIndex(model.newMessageIndex, ListView.Center);
}
}
}

Connections
{
target: dialogpage.context.positionSource
@@ -47,8 +62,6 @@ SilicaListView
verticalLayoutDirection: ListView.BottomToTop
currentIndex: -1

Component.onCompleted: messageslist.positionViewAtIndex(model.newMessageIndex, ListView.Center);

onSelectionModeChanged: {
if(selectionMode) {
selectedMessages = new Object;
4 changes: 4 additions & 0 deletions harbour-sailorgram/qml/pages/dialog/DialogPage.qml
Original file line number Diff line number Diff line change
@@ -24,6 +24,10 @@ Page

messagesmodel.dialog = dialog;
firstLoad = false;

if (status == PageStatus.Active && messageslist.model.newMessageIndex >= 0 && messageslist.model.newMessageIndex < messageslist.count) {
messageslist.positionViewAtIndex(messageslist.model.newMessageIndex, ListView.Center);
}
}

MessagesModel