From e017c5423af434de8afe6e301503c06cd7972d93 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 23 Dec 2016 17:07:56 +0100 Subject: [PATCH] unstable (header of SmartSearch...) --- tests/ui/modules/Common/SearchBox.qml | 2 ++ tests/ui/modules/Linphone/SmartSearchBar.qml | 31 +++++++++++++------ .../App/Styles/MainWindow/MainWindowStyle.qml | 4 +-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/tests/ui/modules/Common/SearchBox.qml b/tests/ui/modules/Common/SearchBox.qml index 0dbbbcaaf..0fa197d8c 100644 --- a/tests/ui/modules/Common/SearchBox.qml +++ b/tests/ui/modules/Common/SearchBox.qml @@ -12,6 +12,8 @@ import Utils 1.0 Item { id: searchBox + property alias header: menu.header + property alias delegate: list.delegate property alias entryHeight: menu.entryHeight property alias maxMenuHeight: menu.maxMenuHeight diff --git a/tests/ui/modules/Linphone/SmartSearchBar.qml b/tests/ui/modules/Linphone/SmartSearchBar.qml index 6c48b5ee9..f7b490eda 100644 --- a/tests/ui/modules/Linphone/SmartSearchBar.qml +++ b/tests/ui/modules/Linphone/SmartSearchBar.qml @@ -10,6 +10,12 @@ import LinphoneUtils 1.0 SearchBox { id: searchBox + header: Rectangle { + color: '#4B5964' + height: 40 + width: 10 + } + delegate: Rectangle { id: searchBoxEntry @@ -45,24 +51,23 @@ SearchBox { Avatar { id: avatar + Layout.preferredHeight: 30 Layout.preferredWidth: 30 + image: $entry.contact && $entry.contact.vcard.avatar presenceLevel: $entry.contact ? $entry.contact.presenceLevel : -1 username: LinphoneUtils.getContactUsername($entry.contact || $entry.sipAddress) } - Text { + ContactDescription { + Layout.fillHeight: true Layout.fillWidth: true - color: '#4B5964' - elide: Text.ElideRight - font { - bold: true - pointSize: 9 - } - - text: $entry.contact ? $entry.contact.vcard.username : $entry.sipAddress + sipAddress: $entry.sipAddress + sipAddressColor: '#A1A1A1' + username: avatar.username + usernameColor: '#4B5964' } // --------------------------------------------------------------------- @@ -88,7 +93,7 @@ SearchBox { searchBox.hideMenu() window.ensureCollapsed() window.setView('Conversation', { - sipAddress: $entry.sipAddress || $entry.vcard.sipAddresses[0] // FIXME: Display menu if many addresses. + sipAddress: $entry.sipAddress }) } } @@ -96,6 +101,12 @@ SearchBox { } } + Rectangle { + color: '#CBCBCB' + height: 1 + width: parent.width + } + // ------------------------------------------------------------------------- states: State { diff --git a/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml b/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml index f049e81a8..adb2510b4 100644 --- a/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml +++ b/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml @@ -3,7 +3,7 @@ import QtQuick 2.7 import Common 1.0 -// =================================================================== +// ============================================================================= QtObject { property int minimumHeight: 480 @@ -30,7 +30,7 @@ QtObject { } property QtObject searchBox: QtObject { - property int entryHeight: 50 + property int entryHeight: 51 property int maxHeight: 300 // See Hick's law for good choice. }