Change display limit values to avoid erratic loading behavior on lists.
Select first history call item on load.
This commit is contained in:
parent
f1c9301533
commit
d9692265be
4 changed files with 34 additions and 21 deletions
|
|
@ -303,8 +303,8 @@ Flickable{
|
||||||
id: contactsProxy
|
id: contactsProxy
|
||||||
parentProxy: mainItem.mainModel
|
parentProxy: mainItem.mainModel
|
||||||
filterType: MagicSearchProxy.FilteringTypes.App | (mainItem.searchText != '*' && mainItem.searchText != '' || SettingsCpp.syncLdapContacts ? MagicSearchProxy.FilteringTypes.Ldap : 0)
|
filterType: MagicSearchProxy.FilteringTypes.App | (mainItem.searchText != '*' && mainItem.searchText != '' || SettingsCpp.syncLdapContacts ? MagicSearchProxy.FilteringTypes.Ldap : 0)
|
||||||
initialDisplayItems: 20
|
initialDisplayItems: Math.max(20, 2 * mainItem.height / (63 * DefaultStyle.dp))
|
||||||
displayItemsStep: 5
|
displayItemsStep: 3 * initialDisplayItems / 2
|
||||||
onLocalFriendCreated: (index) => {
|
onLocalFriendCreated: (index) => {
|
||||||
contactsList.selectIndex(index)
|
contactsList.selectIndex(index)
|
||||||
}
|
}
|
||||||
|
|
@ -338,9 +338,9 @@ Flickable{
|
||||||
id: suggestionsProxy
|
id: suggestionsProxy
|
||||||
parentProxy: mainItem.mainModel
|
parentProxy: mainItem.mainModel
|
||||||
filterType: mainItem.hideSuggestions ? MagicSearchProxy.FilteringTypes.None : MagicSearchProxy.FilteringTypes.Other
|
filterType: mainItem.hideSuggestions ? MagicSearchProxy.FilteringTypes.None : MagicSearchProxy.FilteringTypes.Other
|
||||||
initialDisplayItems: contactsProxy.haveMore && contactsList.expanded ? 0 : 20
|
initialDisplayItems: contactsProxy.haveMore && contactsList.expanded ? 0 : Math.max(20, 2 * mainItem.height / (63 * DefaultStyle.dp))
|
||||||
onInitialDisplayItemsChanged: maxDisplayItems = initialDisplayItems
|
onInitialDisplayItemsChanged: maxDisplayItems = initialDisplayItems
|
||||||
displayItemsStep: 5
|
displayItemsStep: 3 * initialDisplayItems / 2
|
||||||
onModelReset: maxDisplayItems = initialDisplayItems
|
onModelReset: maxDisplayItems = initialDisplayItems
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ ListView {
|
||||||
id: confInfoProxy
|
id: confInfoProxy
|
||||||
filterText: searchBarText
|
filterText: searchBarText
|
||||||
filterType: ConferenceInfoProxy.None
|
filterType: ConferenceInfoProxy.None
|
||||||
initialDisplayItems: mainItem.height / (63 * DefaultStyle.dp) + 5
|
initialDisplayItems: 2 * mainItem.height / (63 * DefaultStyle.dp)
|
||||||
displayItemsStep: initialDisplayItems/2
|
displayItemsStep: initialDisplayItems/2
|
||||||
function selectData(confInfoGui){
|
function selectData(confInfoGui){
|
||||||
mainItem.currentIndex = loadUntil(confInfoGui)
|
mainItem.currentIndex = loadUntil(confInfoGui)
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,8 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
Popup {
|
Popup {
|
||||||
id: currentCallNotif
|
id: currentCallNotif
|
||||||
background: Item{}
|
background: Item{}
|
||||||
|
|
@ -103,7 +105,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
|
|
@ -249,9 +249,8 @@ AbstractMainPage {
|
||||||
id: callHistoryProxy
|
id: callHistoryProxy
|
||||||
filterText: searchBar.text
|
filterText: searchBar.text
|
||||||
onFilterTextChanged: maxDisplayItems = initialDisplayItems
|
onFilterTextChanged: maxDisplayItems = initialDisplayItems
|
||||||
initialDisplayItems: historyListView.height / (56 * DefaultStyle.dp) + 5
|
initialDisplayItems: Math.max(20, 2 * historyListView.height / (56 * DefaultStyle.dp))
|
||||||
displayItemsStep: initialDisplayItems / 2
|
displayItemsStep: 3 * initialDisplayItems / 2
|
||||||
|
|
||||||
}
|
}
|
||||||
cacheBuffer: contentHeight>0 ? contentHeight : 0// cache all items
|
cacheBuffer: contentHeight>0 ? contentHeight : 0// cache all items
|
||||||
flickDeceleration: 10000
|
flickDeceleration: 10000
|
||||||
|
|
@ -271,8 +270,14 @@ AbstractMainPage {
|
||||||
onContentHeightChanged: Qt.callLater(function(){
|
onContentHeightChanged: Qt.callLater(function(){
|
||||||
historyListView.cacheBuffer = Math.max(contentHeight,0)
|
historyListView.cacheBuffer = Math.max(contentHeight,0)
|
||||||
})
|
})
|
||||||
onActiveFocusChanged: if(activeFocus && currentIndex <0) currentIndex = 0
|
onActiveFocusChanged: if(activeFocus && currentIndex < 0 && count > 0) currentIndex = 0
|
||||||
|
onCountChanged: {
|
||||||
|
if(currentIndex < 0 && count > 0){
|
||||||
|
historyListView.currentIndex = 0 // Select first item after loading model
|
||||||
|
}
|
||||||
|
if(atYBeginning)
|
||||||
|
positionViewAtBeginning()// Stay at beginning
|
||||||
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: deleteHistoryPopup
|
target: deleteHistoryPopup
|
||||||
function onAccepted() {
|
function onAccepted() {
|
||||||
|
|
@ -285,7 +290,20 @@ AbstractMainPage {
|
||||||
callHistoryProxy.reload()
|
callHistoryProxy.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onAtYEndChanged: if(atYEnd) callHistoryProxy.displayMore()
|
onAtYEndChanged: {
|
||||||
|
if(atYEnd && count > 0){
|
||||||
|
callHistoryProxy.displayMore()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onCurrentIndexChanged: {
|
||||||
|
if(currentIndex == 0) positionViewAtBeginning()
|
||||||
|
else positionViewAtIndex(currentIndex, ListView.Visible)
|
||||||
|
mainItem.selectedRowHistoryGui = model.getAt(currentIndex)
|
||||||
|
}
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (!visible) currentIndex = -1
|
||||||
|
}
|
||||||
delegate: FocusScope {
|
delegate: FocusScope {
|
||||||
width:historyListView.width
|
width:historyListView.width
|
||||||
height: 56 * DefaultStyle.dp
|
height: 56 * DefaultStyle.dp
|
||||||
|
|
@ -408,13 +426,7 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onCurrentIndexChanged: {
|
|
||||||
positionViewAtIndex(currentIndex, ListView.Visible)
|
|
||||||
mainItem.selectedRowHistoryGui = model.getAt(currentIndex)
|
|
||||||
}
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (!visible) currentIndex = -1
|
|
||||||
}
|
|
||||||
Control.ScrollBar.vertical: scrollbar
|
Control.ScrollBar.vertical: scrollbar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -788,8 +800,8 @@ AbstractMainPage {
|
||||||
id: detailsHistoryProxy
|
id: detailsHistoryProxy
|
||||||
filterText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : ""
|
filterText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : ""
|
||||||
onFilterTextChanged: maxDisplayItems = initialDisplayItems
|
onFilterTextChanged: maxDisplayItems = initialDisplayItems
|
||||||
initialDisplayItems: detailListView.height / (56 * DefaultStyle.dp) + 5
|
initialDisplayItems: Math.max(20, 2 * detailListView.height / (56 * DefaultStyle.dp))
|
||||||
displayItemsStep: initialDisplayItems / 2
|
displayItemsStep: 3 * initialDisplayItems / 2
|
||||||
}
|
}
|
||||||
onAtYEndChanged: if(atYEnd) detailsHistoryProxy.displayMore()
|
onAtYEndChanged: if(atYEnd) detailsHistoryProxy.displayMore()
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue