From bd7a4a2b853121649a3b2a932d473243d060e461 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 20 Sep 2016 10:28:00 +0200 Subject: [PATCH] feat(mainWindow/contact): description bar --- tests/src/main.cpp | 12 +++--- .../contact/ShortContactDescription.qml | 2 +- tests/ui/views/mainWindow/contact.qml | 43 +++++++++++++++++++ 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/tests/src/main.cpp b/tests/src/main.cpp index 738d3f166..e252273a8 100644 --- a/tests/src/main.cpp +++ b/tests/src/main.cpp @@ -31,10 +31,12 @@ int exec (App &app, QQmlApplicationEngine &engine) { // trayIcon: Left click actions. root->connect(tray_icon, &QSystemTrayIcon::activated, [&root](QSystemTrayIcon::ActivationReason reason) { - if (reason == QSystemTrayIcon::Trigger) - root->requestActivate(); - else if (reason == QSystemTrayIcon::DoubleClick) - root->showNormal(); + if (reason == QSystemTrayIcon::Trigger) { + if (root->visibility() == QWindow::Hidden) + root->showNormal(); + else + root->hide(); + } }); // Build trayIcon menu. @@ -47,7 +49,7 @@ int exec (App &app, QQmlApplicationEngine &engine) { tray_icon->setToolTip("Linphone"); tray_icon->show(); - // RUN. + // Run. return app.exec(); } diff --git a/tests/ui/components/contact/ShortContactDescription.qml b/tests/ui/components/contact/ShortContactDescription.qml index 3728dc195..9b79321c0 100644 --- a/tests/ui/components/contact/ShortContactDescription.qml +++ b/tests/ui/components/contact/ShortContactDescription.qml @@ -11,7 +11,7 @@ Column { clip: true color: '#5A585B' font.pointSize: 11 - font.weight: Font.DemiBold + font.bold: true height: parent.height / 2 id: username verticalAlignment: Text.AlignBottom diff --git a/tests/ui/views/mainWindow/contact.qml b/tests/ui/views/mainWindow/contact.qml index a687d4860..c0dc0b904 100644 --- a/tests/ui/views/mainWindow/contact.qml +++ b/tests/ui/views/mainWindow/contact.qml @@ -2,6 +2,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 +import 'qrc:/ui/components/contact' import 'qrc:/ui/components/form' import 'qrc:/ui/components/scrollBar' @@ -12,6 +13,48 @@ ColumnLayout { Layout.fillWidth: true Layout.preferredHeight: 102 color: '#D1D1D1' + + RowLayout { + anchors.left: parent.left + anchors.leftMargin: 40 + anchors.right: parent.right + anchors.rightMargin: 10 + anchors.verticalCenter: parent.verticalCenter + height: 80 + spacing: 0 + width: parent.width + + Avatar { + Layout.fillHeight: true + Layout.preferredWidth: 80 + Layout.rightMargin: 30 + presence: 'connected' // TODO: Use C++. + username: 'Cameron Andrews' // TODO: Use C++. + } + + // TODO: Replace by text edit. + // Component: EditableShortContactDescription. + ShortContactDescription { + Layout.fillHeight: true + Layout.fillWidth: true + username: 'Cameron Andrews' // TODO: Use C++. + } + + ActionBar { + iconSize: 32 + Layout.alignment: Qt.AlignBottom | Qt.AlignRight + + ActionButton { + icon: 'delete' + onClicked: console.log('clicked!!!') + } + + ActionButton { + icon: 'contact' + onClicked: console.log('clicked!!!') + } + } + } } Flickable {