Commit 3aca8e39 authored by Edric Milaret's avatar Edric Milaret Committed by Stepan Salenikovich

im: move im ui to the right of video

Refs #75424

Change-Id: Ib97e3e0b3adbe5e15a2c77df50c4e5505ef512b4
parent 1eece87b
...@@ -48,6 +48,9 @@ CallWidget::CallWidget(QWidget *parent) : ...@@ -48,6 +48,9 @@ CallWidget::CallWidget(QWidget *parent) :
setActualCall(nullptr); setActualCall(nullptr);
videoRenderer_ = nullptr; videoRenderer_ = nullptr;
connect(ui->videoWidget, SIGNAL(setChatVisibility(bool)),
ui->instantMessagingWidget, SLOT(setVisible(bool)));
try { try {
callModel_ = CallModel::instance(); callModel_ = CallModel::instance();
...@@ -306,7 +309,6 @@ void ...@@ -306,7 +309,6 @@ void
CallWidget::setActualCall(Call* value) CallWidget::setActualCall(Call* value)
{ {
actualCall_ = value; actualCall_ = value;
ui->instantMessagingWidget->setVisible(actualCall_ != nullptr);
ui->instantMessagingWidget->setMediaText(actualCall_); ui->instantMessagingWidget->setMediaText(actualCall_);
} }
......
...@@ -20,6 +20,98 @@ ...@@ -20,6 +20,98 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QWidget" name="CallSubGroup" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item>
<widget class="QFrame" name="videoFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>325</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="VideoView" name="videoWidget" native="true"/>
</item>
<item>
<widget class="QWidget" name="callInvite" native="true">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="callLabel">
<property name="text">
<string>Call</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="acceptButton">
<property name="text">
<string>Accept</string>
</property>
<property name="icon">
<iconset resource="ressources.qrc">
<normaloff>:/images/phone.png</normaloff>:/images/phone.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="refuseButton">
<property name="text">
<string>Refuse</string>
</property>
<property name="icon">
<iconset resource="ressources.qrc">
<normaloff>:/images/phone-hangup.png</normaloff>:/images/phone-hangup.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="callStateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Call State :</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">
...@@ -191,107 +283,28 @@ ...@@ -191,107 +283,28 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="1"> <item row="0" column="2">
<widget class="QWidget" name="CallSubGroup" native="true"> <layout class="QVBoxLayout" name="verticalLayout_8">
<layout class="QVBoxLayout" name="verticalLayout"> <property name="leftMargin">
<property name="sizeConstraint"> <number>0</number>
<enum>QLayout::SetMaximumSize</enum> </property>
</property> <item>
<item> <widget class="InstantMessagingWidget" name="instantMessagingWidget" native="true">
<widget class="QFrame" name="videoFrame"> <property name="sizePolicy">
<property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch>
<horstretch>0</horstretch> <verstretch>0</verstretch>
<verstretch>0</verstretch> </sizepolicy>
</sizepolicy> </property>
</property> <property name="minimumSize">
<property name="minimumSize"> <size>
<size> <width>0</width>
<width>0</width> <height>0</height>
<height>325</height> </size>
</size> </property>
</property> </widget>
<property name="frameShape"> </item>
<enum>QFrame::StyledPanel</enum> </layout>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="VideoView" name="videoWidget" native="true"/>
</item>
<item>
<widget class="QWidget" name="callInvite" native="true">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="callLabel">
<property name="text">
<string>Call</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="acceptButton">
<property name="text">
<string>Accept</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/phone.png</normaloff>:/images/phone.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="refuseButton">
<property name="text">
<string>Refuse</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/phone-hangup.png</normaloff>:/images/phone-hangup.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="callStateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Call State :</string>
</property>
</widget>
</item>
<item>
<widget class="InstantMessagingWidget" name="instantMessagingWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,0,0"> <layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,0,0">
...@@ -320,7 +333,7 @@ ...@@ -320,7 +333,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item alignment="Qt::AlignRight"> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>State:</string> <string>State:</string>
...@@ -352,6 +365,8 @@ ...@@ -352,6 +365,8 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="ressources.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>
...@@ -34,8 +34,7 @@ InstantMessagingWidget::InstantMessagingWidget(QWidget *parent) : ...@@ -34,8 +34,7 @@ InstantMessagingWidget::InstantMessagingWidget(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
ui->messageInput->hide(); this->hide();
ui->messageOutput->hide();
imDelegate_ = new ImDelegate(); imDelegate_ = new ImDelegate();
ui->messageOutput->setItemDelegate(imDelegate_); ui->messageOutput->setItemDelegate(imDelegate_);
...@@ -79,12 +78,9 @@ InstantMessagingWidget::setMediaText(Call *call) ...@@ -79,12 +78,9 @@ InstantMessagingWidget::setMediaText(Call *call)
textMedia->send(ui->messageInput->text()); textMedia->send(ui->messageInput->text());
ui->messageInput->clear(); ui->messageInput->clear();
}); });
ui->messageInput->show();
} else { } else {
ui->messageOutput->disconnect(); ui->messageOutput->disconnect();
ui->messageInput->disconnect(); ui->messageInput->disconnect();
ui->messageOutput->hide();
ui->messageInput->hide();
} }
} }
...@@ -104,7 +100,7 @@ InstantMessagingWidget::mediaAdd(Media::Media *media) ...@@ -104,7 +100,7 @@ InstantMessagingWidget::mediaAdd(Media::Media *media)
connect(ui->messageOutput->model(), connect(ui->messageOutput->model(),
SIGNAL(rowsInserted(const QModelIndex&, int, int)), SIGNAL(rowsInserted(const QModelIndex&, int, int)),
ui->messageOutput, SLOT(scrollToBottom())); ui->messageOutput, SLOT(scrollToBottom()));
ui->messageOutput->show(); this->show();
} }
break; break;
case Media::Media::Type::FILE: case Media::Media::Type::FILE:
......
...@@ -27,6 +27,8 @@ VideoOverlay::VideoOverlay(QWidget *parent) : ...@@ -27,6 +27,8 @@ VideoOverlay::VideoOverlay(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
ui->chatButton->setCheckable(true);
actionModel_ = CallModel::instance()->userActionModel(); actionModel_ = CallModel::instance()->userActionModel();
setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_NoSystemBackground);
} }
...@@ -59,11 +61,12 @@ void ...@@ -59,11 +61,12 @@ void
VideoOverlay::on_hangupButton_clicked() VideoOverlay::on_hangupButton_clicked()
{ {
actionModel_->execute(UserActionModel::Action::HANGUP); actionModel_->execute(UserActionModel::Action::HANGUP);
ui->chatButton->setChecked(false);
} }
void void
VideoOverlay::on_chatButton_toggled(bool checked) VideoOverlay::on_chatButton_toggled(bool checked)
{ {
//TODO : Link this to im class once it's merged emit setChatVisibility(checked);
} }
...@@ -48,6 +48,9 @@ private slots: ...@@ -48,6 +48,9 @@ private slots:
private: private:
Ui::VideoOverlay *ui; Ui::VideoOverlay *ui;
UserActionModel* actionModel_; UserActionModel* actionModel_;
signals:
void setChatVisibility(bool visible);
}; };
#endif // VIDEOOVERLAY_H #endif // VIDEOOVERLAY_H
...@@ -62,6 +62,9 @@ VideoView::VideoView(QWidget *parent) : ...@@ -62,6 +62,9 @@ VideoView::VideoView(QWidget *parent) :
this->setContextMenuPolicy(Qt::CustomContextMenu); this->setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
this, SLOT(showContextMenu(const QPoint&))); this, SLOT(showContextMenu(const QPoint&)));
connect(overlay_, &VideoOverlay::setChatVisibility, [=](bool visible) {
emit this->setChatVisibility(visible);
});
} }
VideoView::~VideoView() VideoView::~VideoView()
...@@ -103,6 +106,7 @@ VideoView::callStateChanged(Call* call, Call::State previousState) ...@@ -103,6 +106,7 @@ VideoView::callStateChanged(Call* call, Call::State previousState)
overlay_->setName(call->formattedName()); overlay_->setName(call->formattedName());
} }
else { else {
emit setChatVisibility(false);
ui->videoWidget->hide(); ui->videoWidget->hide();
if (isFullScreen()) if (isFullScreen())
toggleFullScreen(); toggleFullScreen();
......
...@@ -61,6 +61,8 @@ private: ...@@ -61,6 +61,8 @@ private:
QSize oldSize_; QSize oldSize_;
private: private:
void toggleFullScreen(); void toggleFullScreen();
signals:
void setChatVisibility(bool visible);
}; };
#endif // VIDEOVIEW_H #endif // VIDEOVIEW_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment