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) :
setActualCall(nullptr);
videoRenderer_ = nullptr;
connect(ui->videoWidget, SIGNAL(setChatVisibility(bool)),
ui->instantMessagingWidget, SLOT(setVisible(bool)));
try {
callModel_ = CallModel::instance();
......@@ -306,7 +309,6 @@ void
CallWidget::setActualCall(Call* value)
{
actualCall_ = value;
ui->instantMessagingWidget->setVisible(actualCall_ != nullptr);
ui->instantMessagingWidget->setMediaText(actualCall_);
}
......
......@@ -20,6 +20,98 @@
<string>Form</string>
</property>
<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">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
......@@ -191,107 +283,28 @@
</item>
</layout>
</item>
<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>
<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 row="0" column="2">
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="InstantMessagingWidget" name="instantMessagingWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,0,0">
......@@ -320,7 +333,7 @@
</property>
</widget>
</item>
<item alignment="Qt::AlignRight">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>State:</string>
......@@ -352,6 +365,8 @@
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="ressources.qrc"/>
</resources>
<connections/>
</ui>
......@@ -34,8 +34,7 @@ InstantMessagingWidget::InstantMessagingWidget(QWidget *parent) :
{
ui->setupUi(this);
ui->messageInput->hide();
ui->messageOutput->hide();
this->hide();
imDelegate_ = new ImDelegate();
ui->messageOutput->setItemDelegate(imDelegate_);
......@@ -79,12 +78,9 @@ InstantMessagingWidget::setMediaText(Call *call)
textMedia->send(ui->messageInput->text());
ui->messageInput->clear();
});
ui->messageInput->show();
} else {
ui->messageOutput->disconnect();
ui->messageInput->disconnect();
ui->messageOutput->hide();
ui->messageInput->hide();
}
}
......@@ -104,7 +100,7 @@ InstantMessagingWidget::mediaAdd(Media::Media *media)
connect(ui->messageOutput->model(),
SIGNAL(rowsInserted(const QModelIndex&, int, int)),
ui->messageOutput, SLOT(scrollToBottom()));
ui->messageOutput->show();
this->show();
}
break;
case Media::Media::Type::FILE:
......
......@@ -27,6 +27,8 @@ VideoOverlay::VideoOverlay(QWidget *parent) :
{
ui->setupUi(this);
ui->chatButton->setCheckable(true);
actionModel_ = CallModel::instance()->userActionModel();
setAttribute(Qt::WA_NoSystemBackground);
}
......@@ -59,11 +61,12 @@ void
VideoOverlay::on_hangupButton_clicked()
{
actionModel_->execute(UserActionModel::Action::HANGUP);
ui->chatButton->setChecked(false);
}
void
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:
private:
Ui::VideoOverlay *ui;
UserActionModel* actionModel_;
signals:
void setChatVisibility(bool visible);
};
#endif // VIDEOOVERLAY_H
......@@ -62,6 +62,9 @@ VideoView::VideoView(QWidget *parent) :
this->setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
this, SLOT(showContextMenu(const QPoint&)));
connect(overlay_, &VideoOverlay::setChatVisibility, [=](bool visible) {
emit this->setChatVisibility(visible);
});
}
VideoView::~VideoView()
......@@ -103,6 +106,7 @@ VideoView::callStateChanged(Call* call, Call::State previousState)
overlay_->setName(call->formattedName());
}
else {
emit setChatVisibility(false);
ui->videoWidget->hide();
if (isFullScreen())
toggleFullScreen();
......
......@@ -61,6 +61,8 @@ private:
QSize oldSize_;
private:
void toggleFullScreen();
signals:
void setChatVisibility(bool visible);
};
#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