From 31484f1a0f6b02368016041df3f1b8461427402d Mon Sep 17 00:00:00 2001 From: Edric Milaret Date: Tue, 2 Feb 2016 14:26:27 -0500 Subject: [PATCH] video: refactor overlay - Add a button to add cm to contact in call - Add a pause label to clarify HOLD state - Add checked state feedback for hold button - Fixed missing tooltip Change-Id: I3d07b333477f5b3159e387cd65a065579ca4fe86 Tuleap: #322 --- images/ic_pause_white.svg | 4 + ressources.qrc | 93 ++-- stylesheet.css | 14 +- videooverlay.cpp | 20 + videooverlay.h | 1 + videooverlay.ui | 912 ++++++++++++++++++++++---------------- 6 files changed, 597 insertions(+), 447 deletions(-) create mode 100644 images/ic_pause_white.svg diff --git a/images/ic_pause_white.svg b/images/ic_pause_white.svg new file mode 100644 index 0000000..c6974b9 --- /dev/null +++ b/images/ic_pause_white.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ressources.qrc b/ressources.qrc index dc12fe6..acb7daa 100644 --- a/ressources.qrc +++ b/ressources.qrc @@ -1,48 +1,49 @@ - - images/video-conf/btn-join.svg - stylesheet.css - images/ring.png - images/arrow-down-bold-circle-outline.png - images/arrow-left-bold.png - images/arrow-up-bold-circle-outline.png - images/close.png - images/logo-ring-standard-coul.png - images/minus.png - images/plus.png - images/settings.png - images/arrow-down.png - images/arrow-up.png - images/folder-download.png - images/arrow-right.png - images/history.png - images/close-ring.png - images/minimize-ring.png - images/maximize-ring.png - images/search-contact.png - images/hover-contact/btn-video.svg - images/hover-contact/btn-chat.svg - images/hover-contact/btn-contactinfo.svg - images/contactswidgetlist.png - images/historylist.png - images/user/btn-default-userpic.svg - images/call/btn-call.svg - images/call/btn-answer.svg - images/call/btn-ignore.svg - images/video-conf/btn-hangup.svg - images/video-conf/btn-pause.svg - images/video-conf/btn-pause-toggled.svg - images/video-conf/btn-chat.svg - images/video-conf/btn-nomic.svg - images/video-conf/btn-nomic-toggled.svg - images/video-conf/btn-novideo.svg - images/video-conf/btn-novideo-toggled.svg - images/video-conf/btn-missing.svg - images/video-conf/btn-add-contact-to-conf.svg - images/video-conf/btn-transfer.svg - images/btn-info.svg - images/ic_arrow_back_white.svg - images/video-conf/ic_high_quality_white.svg - images/ic_send_white.svg - + + images/video-conf/btn-join.svg + stylesheet.css + images/ring.png + images/arrow-down-bold-circle-outline.png + images/arrow-left-bold.png + images/arrow-up-bold-circle-outline.png + images/close.png + images/logo-ring-standard-coul.png + images/minus.png + images/plus.png + images/settings.png + images/arrow-down.png + images/arrow-up.png + images/folder-download.png + images/arrow-right.png + images/history.png + images/close-ring.png + images/minimize-ring.png + images/maximize-ring.png + images/search-contact.png + images/hover-contact/btn-video.svg + images/hover-contact/btn-chat.svg + images/hover-contact/btn-contactinfo.svg + images/contactswidgetlist.png + images/historylist.png + images/user/btn-default-userpic.svg + images/call/btn-call.svg + images/call/btn-answer.svg + images/call/btn-ignore.svg + images/video-conf/btn-hangup.svg + images/video-conf/btn-pause.svg + images/video-conf/btn-pause-toggled.svg + images/video-conf/btn-chat.svg + images/video-conf/btn-nomic.svg + images/video-conf/btn-nomic-toggled.svg + images/video-conf/btn-novideo.svg + images/video-conf/btn-novideo-toggled.svg + images/video-conf/btn-missing.svg + images/video-conf/btn-add-contact-to-conf.svg + images/video-conf/btn-transfer.svg + images/btn-info.svg + images/ic_arrow_back_white.svg + images/video-conf/ic_high_quality_white.svg + images/ic_send_white.svg + images/ic_pause_white.svg + diff --git a/stylesheet.css b/stylesheet.css index feb8743..019f522 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -97,20 +97,18 @@ QPushButton#transferButton, QPushButton#addPersonButton, QPushButton#joinButton, } QPushButton#holdButton:hover, QPushButton#chatButton:hover, QPushButton#noMicButton:hover, QPushButton#noVideoButton:hover, -QPushButton#transferButton:hover, QPushButton#addPersonButton:hover, QPushButton#joinButton:hover, QPushButton#qualityButton:hover{ +QPushButton#transferButton:hover, QPushButton#addPersonButton:hover, QPushButton#joinButton:hover, QPushButton#qualityButton:hover, +QPushButton#addToContactButton:hover{ background-color: rgba(0, 192, 213, 0.6); - border-radius: 18px; - border:solid 1px; } QPushButton#holdButton:pressed, QPushButton#chatButton:pressed, QPushButton#noMicButton:pressed, QPushButton#noVideoButton:pressed, -QPushButton#transferButton:pressed, QPushButton#addPersonButton:pressed, QPushButton#joinButton:pressed, QPushButton#qualityButton:pressed{ +QPushButton#transferButton:pressed, QPushButton#addPersonButton:pressed, QPushButton#joinButton:pressed, QPushButton#qualityButton:pressed, +QPushButton#addToContactButton:pressed{ background-color: rgba(0, 192, 213, 0.8); - border-radius: 18px; - border:solid 1px; } -QPushButton#noMicButton:checked, QPushButton#noVideoButton:checked{ +QPushButton#holdButton:checked, QPushButton#noMicButton:checked, QPushButton#noVideoButton:checked{ background-color: rgba(0, 192, 213, 0.8); } @@ -128,7 +126,7 @@ QPushButton#hangupButton:pressed{ background-color: rgba(255, 0, 0, 0.8); } -QPushButton#imBackButton{ +QPushButton#imBackButton, QPushButton#addToContactButton{ background-color: #414141; border-radius: 15px; border:solid 1px; diff --git a/videooverlay.cpp b/videooverlay.cpp index 5d02898..c239fd4 100644 --- a/videooverlay.cpp +++ b/videooverlay.cpp @@ -19,7 +19,11 @@ #include "videooverlay.h" #include "ui_videooverlay.h" +#include "contactpicker.h" + #include "callmodel.h" +#include "contactmethod.h" +#include "person.h" VideoOverlay::VideoOverlay(QWidget* parent) : QWidget(parent), @@ -57,6 +61,7 @@ VideoOverlay::VideoOverlay(QWidget* parent) : case UserActionModel::Action::HOLD: ui->holdButton->setChecked(idx.data(Qt::CheckStateRole).value()); ui->holdButton->setEnabled(idx.flags() & Qt::ItemIsEnabled); + ui->onHoldLabel->setVisible(idx.data(Qt::CheckStateRole).value()); break; default: break; @@ -83,6 +88,9 @@ VideoOverlay::VideoOverlay(QWidget* parent) : ui->joinButton->hide(); } + if (auto contactMethod = c->peerContactMethod()) + ui->addToContactButton->setVisible(not contactMethod->contact() + || contactMethod->contact()->isPlaceHolder()); } }); } @@ -177,3 +185,15 @@ VideoOverlay::on_qualityButton_clicked() pos.y() - (qualityDialog_->height())); qualityDialog_->show(); } + +void +VideoOverlay::on_addToContactButton_clicked() +{ + QPoint globalPos = mapToGlobal(ui->addToContactButton->pos()); + if (auto contactMethod = CallModel::instance().selectedCall()->peerContactMethod()) { + ContactPicker contactPicker(contactMethod); + contactPicker.move(globalPos.x(), + globalPos.y() + ui->addToContactButton->height()); + contactPicker.exec(); + } +} diff --git a/videooverlay.h b/videooverlay.h index 322ad62..18f9bf6 100644 --- a/videooverlay.h +++ b/videooverlay.h @@ -53,6 +53,7 @@ private slots: void on_noMicButton_clicked(); void on_noVideoButton_clicked(); void on_qualityButton_clicked(); + void on_addToContactButton_clicked(); private: Ui::VideoOverlay* ui; diff --git a/videooverlay.ui b/videooverlay.ui index 4dd8f27..7a1b042 100644 --- a/videooverlay.ui +++ b/videooverlay.ui @@ -22,402 +22,528 @@ - - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-hangup.svg:/images/video-conf/btn-hangup.svg - - - - 36 - 36 - - - - - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 143 - 146 - 147 - - - - - - - - - - - - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-join.svg:/images/video-conf/btn-join.svg - - - - 36 - 36 - - - - + - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-pause.svg:/images/video-conf/btn-pause.svg - - - - 36 - 36 - - - - true - - - - - - - - 0 - 0 - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-nomic.svg:/images/video-conf/btn-nomic.svg - - - - 36 - 36 - - - - true - - - - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-chat.svg:/images/video-conf/btn-chat.svg - - - - 36 - 36 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 143 - 146 - 147 - - - - - - - - 00:00 - - - - - - - - 0 - 0 - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-novideo.svg:/images/video-conf/btn-novideo.svg - - - - 36 - 36 - - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-add-contact-to-conf.svg:/images/video-conf/btn-add-contact-to-conf.svg - - - - 36 - 36 - - - + + + + + + 100 + 100 + + + + + 100 + 100 + + + + + PreferAntialias + + + + Call on Hold + + + false + + + + + + :/images/ic_pause_white.svg + + + true + + + + - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/btn-transfer.svg:/images/video-conf/btn-transfer.svg - - - - 36 - 36 - - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 36 + 36 + + + + + 36 + 36 + + + + Hangup + + + + + + + :/images/video-conf/btn-hangup.svg:/images/video-conf/btn-hangup.svg + + + + 36 + 36 + + + + + + + + + 36 + 36 + + + + + 36 + 36 + + + + Hold / Unhold + + + + + + + :/images/video-conf/btn-pause.svg:/images/video-conf/btn-pause.svg + + + + 36 + 36 + + + + true + + + + + + + + 36 + 36 + + + + + 36 + 36 + + + + Chat + + + + + + + :/images/video-conf/btn-chat.svg:/images/video-conf/btn-chat.svg + + + + 36 + 36 + + + + + + + + + 36 + 36 + + + + + 36 + 36 + + + + Add person to call + + + + + + + :/images/video-conf/btn-add-contact-to-conf.svg:/images/video-conf/btn-add-contact-to-conf.svg + + + + 36 + 36 + + + + + + + + + 36 + 36 + + + + + 36 + 36 + + + + Transfer call + + + + + + + :/images/video-conf/btn-transfer.svg:/images/video-conf/btn-transfer.svg + + + + 36 + 36 + + + + + + + + + 0 + 0 + + + + + 36 + 36 + + + + + 36 + 36 + + + + Mute Mic + + + + + + + :/images/video-conf/btn-nomic.svg:/images/video-conf/btn-nomic.svg + + + + 36 + 36 + + + + true + + + + + + + + 0 + 0 + + + + + 36 + 36 + + + + + 36 + 36 + + + + Mute Video + + + + + + + :/images/video-conf/btn-novideo.svg:/images/video-conf/btn-novideo.svg + + + + 36 + 36 + + + + true + + + + + + + + 36 + 36 + + + + + 36 + 36 + + + + Quality + + + + + + + :/images/video-conf/ic_high_quality_white.svg:/images/video-conf/ic_high_quality_white.svg + + + + 36 + 36 + + + + + + + + + 36 + 36 + + + + + 36 + 36 + + + + Join Calls + + + + + + + :/images/video-conf/btn-join.svg:/images/video-conf/btn-join.svg + + + + 36 + 36 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - - - 36 - 36 - - - - - 36 - 36 - - - - - - - - :/images/video-conf/ic_high_quality_white.svg:/images/video-conf/ic_high_quality_white.svg - - - - 36 - 36 - - - + + + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 143 + 146 + 147 + + + + + + + + Name label + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + Add to contact + + + + + + + :/images/video-conf/btn-add-contact-to-conf.svg:/images/video-conf/btn-add-contact-to-conf.svg + + + + 30 + 30 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 143 + 146 + 147 + + + + + + + + Time elapsed + + + 00:00 + + + + -- GitLab