From b729dfa3957e71e90407e7b502bcf0e8ac8eb81b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 14 Sep 2016 14:57:07 +0200 Subject: [PATCH] fix(mainWindow/conversation): display contact actions --- tests/resources.qrc | 1 + tests/ui/components/dialog/DialogPlus.qml | 1 - tests/ui/components/form/ActionBar.qml | 2 +- tests/ui/views/mainWindow/contacts.qml | 49 ++++++++++++++++++----- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/tests/resources.qrc b/tests/resources.qrc index 009368127..e3c4d4dc4 100644 --- a/tests/resources.qrc +++ b/tests/resources.qrc @@ -31,6 +31,7 @@ imgs/led_do_not_disturb.svg imgs/conference.svg imgs/cam.svg + imgs/chat.svg imgs/chat_attachment.svg imgs/led_connected.svg imgs/led_absent.svg diff --git a/tests/ui/components/dialog/DialogPlus.qml b/tests/ui/components/dialog/DialogPlus.qml index 15df4939b..68f52dfef 100644 --- a/tests/ui/components/dialog/DialogPlus.qml +++ b/tests/ui/components/dialog/DialogPlus.qml @@ -10,7 +10,6 @@ Window { default property alias content: content.data // Required. property alias buttons: buttons.data // Required. property alias descriptionText: description.text // Optionnal. - property bool centeredButtons // Optionnal. modality: Qt.WindowModal diff --git a/tests/ui/components/form/ActionBar.qml b/tests/ui/components/form/ActionBar.qml index 64ad659b0..335880879 100644 --- a/tests/ui/components/form/ActionBar.qml +++ b/tests/ui/components/form/ActionBar.qml @@ -1,7 +1,7 @@ import QtQuick 2.7 // =================================================================== -// Bar which can contains ActionButton. +// Bar which can contains ActionButtons. // =================================================================== Row { diff --git a/tests/ui/views/mainWindow/contacts.qml b/tests/ui/views/mainWindow/contacts.qml index 0cbd2b7c6..063ee5520 100644 --- a/tests/ui/views/mainWindow/contacts.qml +++ b/tests/ui/views/mainWindow/contacts.qml @@ -26,15 +26,14 @@ ColumnLayout { TextField { Layout.fillWidth: true - Layout.preferredHeight: parent.height background: Rectangle { color: '#EAEAEA' + implicitHeight: 30 } placeholderText: qsTr('searchContactPlaceholder') } ExclusiveButtons { - Layout.preferredHeight: parent.height texts: [ qsTr('selectAllContacts'), qsTr('selectConnectedContacts') @@ -42,7 +41,6 @@ ColumnLayout { } LightButton { - Layout.preferredHeight: parent.height text: qsTr('addContact') } } @@ -156,6 +154,13 @@ ColumnLayout { id: contact width: parent.width + MouseArea { + anchors.fill: parent + hoverEnabled: true + onEntered: contact.state = 'hover' + onExited: contact.state = '' + } + Item { anchors.verticalCenter: parent.verticalCenter height: 30 @@ -199,24 +204,46 @@ ColumnLayout { font.weight: Font.DemiBold text: $username verticalAlignment: Text.AlignVCenter - - MouseArea { - anchors.fill: parent - hoverEnabled: true - onEntered: contact.state = 'hover' - onExited: contact.state = '' - } } } // Actions. - // TODO. + Row { + Layout.fillHeight: true + id: actions + spacing: 50 + visible: false + + ActionBar { + iconSize: parent.height + + ActionButton { + icon: 'cam' + } + + ActionButton { + icon: 'call' + } + + ActionButton { + icon: 'chat' + } + } + + ActionButton { + iconSize: parent.height + icon: 'delete' + onClicked: console.log('toto') + } + } } } + states: State { name: 'hover' PropertyChanges { target: contact; color: '#D1D1D1' } + PropertyChanges { target: actions; visible: true } } } }