diff --git a/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml b/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml index 026ac09fb..c9ed7edd3 100644 --- a/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml +++ b/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml @@ -4,9 +4,9 @@ import Common 1.0 import Common.Styles 1.0 import Utils 1.0 -// =================================================================== +// ============================================================================= // Low component to display a list/menu in a popup. -// =================================================================== +// ============================================================================= Item { id: menu @@ -27,7 +27,7 @@ Item { signal menuClosed signal menuOpened - // ----------------------------------------------------------------- + // --------------------------------------------------------------------------- function isOpen () { return _isOpen @@ -58,7 +58,7 @@ Item { throw new Error('Virtual method must be implemented.') } - // ----------------------------------------------------------------- + // --------------------------------------------------------------------------- implicitHeight: 0 opacity: 0 @@ -74,7 +74,7 @@ Item { } } - // Block clicks, wheel... below menu. + // Handle clicks, wheel... below menu. MouseArea { anchors.fill: parent hoverEnabled: true @@ -100,14 +100,13 @@ Item { enabled: parent.visible onPressed: { - if (launcher != null && pointIsInItem(launcher)) { - return + if (launcher == null || !pointIsInItem(launcher)) { + hideMenu() } - hideMenu() } } - // ----------------------------------------------------------------- + // --------------------------------------------------------------------------- states: State { name: 'opened' diff --git a/tests/ui/modules/Common/Popup/DesktopPopup.qml b/tests/ui/modules/Common/Popup/DesktopPopup.qml index 21031f9d1..9426051ca 100644 --- a/tests/ui/modules/Common/Popup/DesktopPopup.qml +++ b/tests/ui/modules/Common/Popup/DesktopPopup.qml @@ -3,7 +3,7 @@ import QtQuick.Window 2.2 import Common.Styles 1.0 -// =================================================================== +// ============================================================================= Item { id: wrapper @@ -27,7 +27,7 @@ Item { _isOpen = false } - // ----------------------------------------------------------------- + // --------------------------------------------------------------------------- // DO NOT TOUCH THIS PROPERTIES. @@ -51,12 +51,11 @@ Item { Item { id: content - // Fake parent. property var $parent: wrapper } } - // ----------------------------------------------------------------- + // --------------------------------------------------------------------------- states: State { name: 'opened' diff --git a/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml b/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml index 1b90b241c..c7d6e7074 100644 --- a/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml +++ b/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml @@ -1,3 +1,5 @@ +import QtQuick 2.7 + import Utils 1.0 // ============================================================================= @@ -11,13 +13,18 @@ AbstractDropDownMenu { property int maxMenuHeight function _computeHeight () { - var list = _content[0] + Utils.assert(_content != null && _content.length > 0, '`_content` cannot be null and must exists.') + var list = _content[0] Utils.assert(list != null, 'No list found.') Utils.assert(Utils.qmlTypeof(list, 'QQuickListView'), 'No list view parameter.') var height = list.count * entryHeight + if (list.headerPositioning === ListView.OverlayHeader) { + height += list.headerItem.height + } + return (maxMenuHeight !== undefined && height > maxMenuHeight) ? maxMenuHeight : height diff --git a/tests/ui/modules/Common/Popup/DropDownMenu.qml b/tests/ui/modules/Common/Popup/DropDownMenu.qml index 381b1d6bf..90473de27 100644 --- a/tests/ui/modules/Common/Popup/DropDownMenu.qml +++ b/tests/ui/modules/Common/Popup/DropDownMenu.qml @@ -1,6 +1,8 @@ -// =================================================================== +import Utils 1.0 + +// ============================================================================= // Menu which supports menu like `ActionMenu` or `Menu`. -// =================================================================== +// ============================================================================= AbstractDropDownMenu { function _computeHeight () { diff --git a/tests/ui/modules/Common/Popup/PopupShadow.qml b/tests/ui/modules/Common/Popup/PopupShadow.qml index 42078ba1c..cb6e994a3 100644 --- a/tests/ui/modules/Common/Popup/PopupShadow.qml +++ b/tests/ui/modules/Common/Popup/PopupShadow.qml @@ -2,7 +2,7 @@ import QtGraphicalEffects 1.0 import Common.Styles 1.0 -// =================================================================== +// ============================================================================= DropShadow { color: PopupStyle.shadow.color diff --git a/tests/ui/modules/Common/SearchBox.qml b/tests/ui/modules/Common/SearchBox.qml index 0fa197d8c..667fa4e96 100644 --- a/tests/ui/modules/Common/SearchBox.qml +++ b/tests/ui/modules/Common/SearchBox.qml @@ -12,7 +12,7 @@ import Utils 1.0 Item { id: searchBox - property alias header: menu.header + property alias header: list.header property alias delegate: list.delegate property alias entryHeight: menu.entryHeight @@ -105,6 +105,7 @@ Item { id: list anchors.fill: parent + headerPositioning: header ? ListView.OverlayHeader : ListView.InlineFooter } } } diff --git a/tests/ui/modules/Common/View/ScrollableListView.qml b/tests/ui/modules/Common/View/ScrollableListView.qml index 898e9068e..fcf813109 100644 --- a/tests/ui/modules/Common/View/ScrollableListView.qml +++ b/tests/ui/modules/Common/View/ScrollableListView.qml @@ -3,7 +3,7 @@ import QtQuick.Controls 2.0 import Common 1.0 -// =================================================================== +// ============================================================================= ListView { ScrollBar.vertical: ForceScrollBar { diff --git a/tests/ui/modules/Linphone/Contact/Contact.qml b/tests/ui/modules/Linphone/Contact/Contact.qml index dd729d317..ad0cd8622 100644 --- a/tests/ui/modules/Linphone/Contact/Contact.qml +++ b/tests/ui/modules/Linphone/Contact/Contact.qml @@ -34,7 +34,7 @@ Rectangle { Layout.preferredHeight: ContactStyle.contentHeight Layout.preferredWidth: ContactStyle.contentHeight image: _contact && _contact.vcard.avatar - presenceLevel: _contact ? contact.presenceLevel : Presence.White + presenceLevel: _contact ? _contact.presenceLevel : Presence.White username: LinphoneUtils.getContactUsername(_contact || sipAddress) } diff --git a/tests/ui/modules/Linphone/SmartSearchBar.qml b/tests/ui/modules/Linphone/SmartSearchBar.qml index f7b490eda..586c4fd7d 100644 --- a/tests/ui/modules/Linphone/SmartSearchBar.qml +++ b/tests/ui/modules/Linphone/SmartSearchBar.qml @@ -3,7 +3,6 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 -import LinphoneUtils 1.0 // ============================================================================= @@ -13,7 +12,12 @@ SearchBox { header: Rectangle { color: '#4B5964' height: 40 - width: 10 + width: parent.width + + MouseArea { + anchors.fill: parent + hoverEnabled: true + } } delegate: Rectangle { @@ -40,34 +44,18 @@ SearchBox { RowLayout { anchors { fill: parent - leftMargin: 22 rightMargin: 10 } - spacing: 15 + spacing: 0 // --------------------------------------------------------------------- // Contact or address info // --------------------------------------------------------------------- - 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) - } - - ContactDescription { + Contact { Layout.fillHeight: true Layout.fillWidth: true - sipAddress: $entry.sipAddress - sipAddressColor: '#A1A1A1' - username: avatar.username - usernameColor: '#4B5964' } // ---------------------------------------------------------------------