From bcf8b85135978908a6b569ddeaeb9cd27e0c375b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 21 Feb 2017 11:28:27 +0100 Subject: [PATCH] feat(ui/views/App/Main/MainWindow): force collapsed when smart search bar is opened on linux --- .../ui/modules/Common/Form/+linux/SearchBox.qml | 13 ++++++++++--- .../ui/modules/Common/Form/SearchBox.qml | 15 +++++++++++---- linphone-desktop/ui/views/App/Main/MainWindow.qml | 9 ++++++--- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml b/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml index 0604af5a0..2d0d3654f 100644 --- a/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml +++ b/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml @@ -28,6 +28,7 @@ Item { signal menuClosed signal menuOpened + signal menuRequested signal enterPressed // --------------------------------------------------------------------------- @@ -73,7 +74,13 @@ Item { searchBox.enterPressed() } - onActiveFocusChanged: activeFocus && searchBox.showMenu() + onActiveFocusChanged: { + if (activeFocus) { + searchBox.menuRequested() + searchBox.showMenu() + } + } + onTextChanged: _filter(text) } @@ -118,7 +125,7 @@ Item { script: { menu.showMenu() - menuOpened() + searchBox.menuOpened() } } }, @@ -132,7 +139,7 @@ Item { menu.hideMenu() searchField.focus = false - menuClosed() + searchBox.menuClosed() } } } diff --git a/linphone-desktop/ui/modules/Common/Form/SearchBox.qml b/linphone-desktop/ui/modules/Common/Form/SearchBox.qml index 1c9bd8370..2e197ae9b 100644 --- a/linphone-desktop/ui/modules/Common/Form/SearchBox.qml +++ b/linphone-desktop/ui/modules/Common/Form/SearchBox.qml @@ -32,6 +32,7 @@ Item { signal menuClosed signal menuOpened + signal menuRequested signal enterPressed // --------------------------------------------------------------------------- @@ -71,7 +72,7 @@ Item { implicitHeight: searchField.height Item { - implicitHeight: searchField.height + menu.height + implicitHeight: searchField.height width: parent.width TextField { @@ -86,7 +87,13 @@ Item { searchBox.enterPressed() } - onActiveFocusChanged: activeFocus && searchBox.showMenu() + onActiveFocusChanged: { + if (activeFocus) { + searchBox.menuRequested() + searchBox.showMenu() + } + } + onTextChanged: _filter(text) } @@ -151,7 +158,7 @@ Item { menu.showMenu() desktopPopup.show() - menuOpened() + searchBox.menuOpened() } } }, @@ -166,7 +173,7 @@ Item { searchField.focus = false desktopPopup.hide() - menuClosed() + searchBox.menuClosed() } } } diff --git a/linphone-desktop/ui/views/App/Main/MainWindow.qml b/linphone-desktop/ui/views/App/Main/MainWindow.qml index d42cab0dd..2e5d49fb7 100644 --- a/linphone-desktop/ui/views/App/Main/MainWindow.qml +++ b/linphone-desktop/ui/views/App/Main/MainWindow.qml @@ -192,6 +192,10 @@ Controls1.ApplicationWindow { sipAddress: sipAddress }) + onEntryClicked: window.setView(entry.contact ? 'ContactEdit' : 'Conversation', { + sipAddress: entry.sipAddress + }) + onLaunchCall: CallsListModel.launchAudioCall(sipAddress) onLaunchChat: window.setView('Conversation', { sipAddress: sipAddress @@ -199,9 +203,8 @@ Controls1.ApplicationWindow { onLaunchVideoCall: CallsListModel.launchVideoCall(sipAddress) - onEntryClicked: window.setView(entry.contact ? 'ContactEdit' : 'Conversation', { - sipAddress: entry.sipAddress - }) + // Specific linux action.. + onMenuRequested: Qt.platform.os === 'linux' && collapse.setCollapsed(true) } } }