diff --git a/Linphone/view/Control/Display/Contact/AllContactListView.qml b/Linphone/view/Control/Display/Contact/AllContactListView.qml index 7d1bceeb9..ca998b07e 100644 --- a/Linphone/view/Control/Display/Contact/AllContactListView.qml +++ b/Linphone/view/Control/Display/Contact/AllContactListView.qml @@ -303,8 +303,8 @@ Flickable{ id: contactsProxy parentProxy: mainItem.mainModel filterType: MagicSearchProxy.FilteringTypes.App | (mainItem.searchText != '*' && mainItem.searchText != '' || SettingsCpp.syncLdapContacts ? MagicSearchProxy.FilteringTypes.Ldap : 0) - initialDisplayItems: 20 - displayItemsStep: 5 + initialDisplayItems: Math.max(20, 2 * mainItem.height / (63 * DefaultStyle.dp)) + displayItemsStep: 3 * initialDisplayItems / 2 onLocalFriendCreated: (index) => { contactsList.selectIndex(index) } @@ -338,9 +338,9 @@ Flickable{ id: suggestionsProxy parentProxy: mainItem.mainModel 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 - displayItemsStep: 5 + displayItemsStep: 3 * initialDisplayItems / 2 onModelReset: maxDisplayItems = initialDisplayItems } } diff --git a/Linphone/view/Control/Display/Meeting/MeetingListView.qml b/Linphone/view/Control/Display/Meeting/MeetingListView.qml index be3375185..d739d5ed8 100644 --- a/Linphone/view/Control/Display/Meeting/MeetingListView.qml +++ b/Linphone/view/Control/Display/Meeting/MeetingListView.qml @@ -103,7 +103,7 @@ ListView { id: confInfoProxy filterText: searchBarText filterType: ConferenceInfoProxy.None - initialDisplayItems: mainItem.height / (63 * DefaultStyle.dp) + 5 + initialDisplayItems: 2 * mainItem.height / (63 * DefaultStyle.dp) displayItemsStep: initialDisplayItems/2 function selectData(confInfoGui){ mainItem.currentIndex = loadUntil(confInfoGui) diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index ca4633c73..1e4f0f9df 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -79,6 +79,8 @@ Item { } Item{ + anchors.fill: parent + Popup { id: currentCallNotif background: Item{} @@ -103,7 +105,6 @@ Item { } } } - anchors.fill: parent RowLayout { anchors.fill: parent diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index 7f915dc13..740b6f269 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -249,9 +249,8 @@ AbstractMainPage { id: callHistoryProxy filterText: searchBar.text onFilterTextChanged: maxDisplayItems = initialDisplayItems - initialDisplayItems: historyListView.height / (56 * DefaultStyle.dp) + 5 - displayItemsStep: initialDisplayItems / 2 - + initialDisplayItems: Math.max(20, 2 * historyListView.height / (56 * DefaultStyle.dp)) + displayItemsStep: 3 * initialDisplayItems / 2 } cacheBuffer: contentHeight>0 ? contentHeight : 0// cache all items flickDeceleration: 10000 @@ -271,8 +270,14 @@ AbstractMainPage { onContentHeightChanged: Qt.callLater(function(){ 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 { target: deleteHistoryPopup function onAccepted() { @@ -285,7 +290,20 @@ AbstractMainPage { 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 { width:historyListView.width 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 } } @@ -788,8 +800,8 @@ AbstractMainPage { id: detailsHistoryProxy filterText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : "" onFilterTextChanged: maxDisplayItems = initialDisplayItems - initialDisplayItems: detailListView.height / (56 * DefaultStyle.dp) + 5 - displayItemsStep: initialDisplayItems / 2 + initialDisplayItems: Math.max(20, 2 * detailListView.height / (56 * DefaultStyle.dp)) + displayItemsStep: 3 * initialDisplayItems / 2 } onAtYEndChanged: if(atYEnd) detailsHistoryProxy.displayMore() delegate: Item {