Skip to content
Snippets Groups Projects
Commit ac3b8b82 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

smartlist: keep focus when clearing the search field

- the focus should be grabbed when selecting another view or
  conversation

Change-Id: I41ab6a7a743615269c4dde01b5503a3ae21a836d
Gitlab: #110
parent 43094bad
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment