mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 14:55:43 +02:00
smartlist: keep focus when clearing the search field
- the focus should be grabbed when selecting another view or conversation Change-Id: I41ab6a7a743615269c4dde01b5503a3ae21a836d Gitlab: #110
This commit is contained in:
parent
43094bad8b
commit
ac3b8b821d
4 changed files with 2 additions and 20 deletions
|
@ -27,12 +27,6 @@ Rectangle {
|
|||
|
||||
signal contactSearchBarTextChanged(string text)
|
||||
|
||||
// Hack - there is no real way now to make TextField lose its focus,
|
||||
// unless transfer it to other component.
|
||||
function clearFocus() {
|
||||
fakeFocus.forceActiveFocus()
|
||||
}
|
||||
|
||||
function clearText() {
|
||||
contactSearchBar.clear()
|
||||
fakeFocus.forceActiveFocus()
|
||||
|
|
|
@ -29,10 +29,8 @@ ListView {
|
|||
signal needToAccessMessageWebView(string currentUserDisplayName, string currentUserAlias, string currentUID, bool callStackViewShouldShow, bool isAudioOnly, int callState)
|
||||
signal needToSelectItems(string conversationUid)
|
||||
signal needToDeselectItems
|
||||
signal needToGrabFocus
|
||||
|
||||
signal needToShowChatView(string accountId, string convUid)
|
||||
signal currentIndexIsChanged
|
||||
signal forceUpdatePotentialInvalidItem
|
||||
|
||||
// Refresh all items within the model.
|
||||
|
@ -81,10 +79,6 @@ ListView {
|
|||
function onUpdateSmartList() { updateListView() }
|
||||
}
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
root.currentIndexIsChanged()
|
||||
}
|
||||
|
||||
clip: true
|
||||
|
||||
delegate: ConversationSmartListViewItemDelegate {
|
||||
|
|
|
@ -42,7 +42,7 @@ ItemDelegate {
|
|||
|
||||
|
||||
// When currentIndex is -1, deselect items, if not, change select item
|
||||
function onCurrentIndexIsChanged() {
|
||||
function onCurrentIndexChanged() {
|
||||
if (conversationSmartListView.currentIndex === -1
|
||||
|| conversationSmartListView.currentIndex !== index) {
|
||||
itemSmartListBackground.color = Qt.binding(function () {
|
||||
|
@ -55,7 +55,6 @@ ItemDelegate {
|
|||
1.8) : JamiTheme.releaseColor
|
||||
})
|
||||
conversationSmartListView.needToSelectItems(UID)
|
||||
conversationSmartListView.needToGrabFocus()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,8 +46,7 @@ Rectangle {
|
|||
// For contact request conv to be focused correctly.
|
||||
function setCurrentUidSmartListModelIndex() {
|
||||
conversationSmartListView.currentIndex
|
||||
= conversationSmartListView.model.currentUidSmartListModelIndex(
|
||||
)
|
||||
= conversationSmartListView.model.currentUidSmartListModelIndex()
|
||||
}
|
||||
|
||||
function updatePendingRequestCount() {
|
||||
|
@ -205,10 +204,6 @@ Rectangle {
|
|||
isAudioOnly, callState)
|
||||
}
|
||||
|
||||
onNeedToGrabFocus: {
|
||||
contactSearchBar.clearFocus()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
ConversationsAdapter.setQmlObject(this)
|
||||
conversationSmartListView.currentIndex = -1
|
||||
|
|
Loading…
Add table
Reference in a new issue