From a5fe70f19bd742b95fd2af9550bea5233ca8c8a6 Mon Sep 17 00:00:00 2001 From: Edric Milaret <edric.ladent-milaret@savoirfairelinux.com> Date: Fri, 5 Feb 2016 15:03:31 -0500 Subject: [PATCH] video: add rec button Change-Id: I84ce6bb441630928d779d3b78c41605130387720 Tuleap: #355 --- images/ic_voicemail_white.svg | 4 ++++ ressources.qrc | 1 + stylesheet.css | 11 +++++++---- videooverlay.cpp | 9 +++++++++ videooverlay.h | 1 + videooverlay.ui | 37 ++++++++++++++++++++++++++++++++++- 6 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 images/ic_voicemail_white.svg diff --git a/images/ic_voicemail_white.svg b/images/ic_voicemail_white.svg new file mode 100644 index 0000000..41f4ff6 --- /dev/null +++ b/images/ic_voicemail_white.svg @@ -0,0 +1,4 @@ +<svg fill="#FFFFFF" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M18.5 6C15.46 6 13 8.46 13 11.5c0 1.33.47 2.55 1.26 3.5H9.74c.79-.95 1.26-2.17 1.26-3.5C11 8.46 8.54 6 5.5 6S0 8.46 0 11.5 2.46 17 5.5 17h13c3.04 0 5.5-2.46 5.5-5.5S21.54 6 18.5 6zm-13 9C3.57 15 2 13.43 2 11.5S3.57 8 5.5 8 9 9.57 9 11.5 7.43 15 5.5 15zm13 0c-1.93 0-3.5-1.57-3.5-3.5S16.57 8 18.5 8 22 9.57 22 11.5 20.43 15 18.5 15z"/> +</svg> \ No newline at end of file diff --git a/ressources.qrc b/ressources.qrc index 83ba733..1a9ac2e 100644 --- a/ressources.qrc +++ b/ressources.qrc @@ -46,5 +46,6 @@ <file>images/ic_send_white.svg</file> <file>images/ic_pause_white.svg</file> <file>images/ic_content_copy_white.svg</file> + <file>images/ic_voicemail_white.svg</file> </qresource> </RCC> diff --git a/stylesheet.css b/stylesheet.css index 6880400..c9a2ef9 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -90,7 +90,8 @@ QLineEdit#messageEdit{ } QPushButton#holdButton, QPushButton#chatButton, QPushButton#noMicButton, QPushButton#noVideoButton, -QPushButton#transferButton, QPushButton#addPersonButton, QPushButton#joinButton, QPushButton#qualityButton{ +QPushButton#transferButton, QPushButton#addPersonButton, QPushButton#joinButton, +QPushButton#qualityButton, QPushButton#recButton{ background-color: rgba(0, 0, 0, 140); border-radius: 18px; border:solid 1px; @@ -98,17 +99,19 @@ 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#addToContactButton:hover{ +QPushButton#addToContactButton:hover, QPushButton#recButton:hover{ background-color: rgba(0, 192, 213, 0.6); } 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#addToContactButton:pressed{ +QPushButton#addToContactButton:pressed, QPushButton#recButton:pressed{ background-color: rgba(0, 192, 213, 0.8); } -QPushButton#holdButton:checked, QPushButton#noMicButton:checked, QPushButton#noVideoButton:checked, QPushButton#chatButton:checked{ +QPushButton#holdButton:checked, QPushButton#noMicButton:checked, +QPushButton#noVideoButton:checked, QPushButton#recButton:checked, +QPushButton#chatButton:checked{ background-color: rgba(0, 192, 213, 0.8); } diff --git a/videooverlay.cpp b/videooverlay.cpp index c239fd4..5052d49 100644 --- a/videooverlay.cpp +++ b/videooverlay.cpp @@ -63,6 +63,9 @@ VideoOverlay::VideoOverlay(QWidget* parent) : ui->holdButton->setEnabled(idx.flags() & Qt::ItemIsEnabled); ui->onHoldLabel->setVisible(idx.data(Qt::CheckStateRole).value<bool>()); break; + case UserActionModel::Action::RECORD: + ui->recButton->setChecked(idx.data(Qt::CheckStateRole).value<bool>()); + ui->recButton->setEnabled(idx.flags() & Qt::ItemIsEnabled); default: break; } @@ -197,3 +200,9 @@ VideoOverlay::on_addToContactButton_clicked() contactPicker.exec(); } } + +void +VideoOverlay::on_recButton_clicked() +{ + actionModel_->execute(UserActionModel::Action::RECORD); +} diff --git a/videooverlay.h b/videooverlay.h index 18f9bf6..d390f6a 100644 --- a/videooverlay.h +++ b/videooverlay.h @@ -54,6 +54,7 @@ private slots: void on_noVideoButton_clicked(); void on_qualityButton_clicked(); void on_addToContactButton_clicked(); + void on_recButton_clicked(); private: Ui::VideoOverlay* ui; diff --git a/videooverlay.ui b/videooverlay.ui index 7a1b042..0b852de 100644 --- a/videooverlay.ui +++ b/videooverlay.ui @@ -22,7 +22,7 @@ <property name="windowTitle"> <string/> </property> - <layout class="QGridLayout" name="gridLayout" rowstretch="0,1,0,0" columnstretch="0,0,2,0,0,0,0,0,0,0,0,0"> + <layout class="QGridLayout" name="gridLayout" rowstretch="0,1,0" columnstretch="0,0,2,0,0"> <item row="1" column="2"> <layout class="QHBoxLayout" name="horizontalLayout_5"> <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> @@ -323,6 +323,41 @@ </property> </widget> </item> + <item> + <widget class="QPushButton" name="recButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>36</width> + <height>36</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>36</width> + <height>36</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="ressources.qrc"> + <normaloff>:/images/ic_voicemail_white.svg</normaloff>:/images/ic_voicemail_white.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>36</width> + <height>36</height> + </size> + </property> + </widget> + </item> <item> <widget class="QPushButton" name="qualityButton"> <property name="minimumSize"> -- GitLab