Polish voice call UI
This commit is contained in:
parent
da9995fc3d
commit
88cfa3a8fa
18 changed files with 348 additions and 146 deletions
|
|
@ -4,12 +4,18 @@
|
|||
#include <QVBoxLayout>
|
||||
|
||||
#include "Config.h"
|
||||
#include "Utils.h"
|
||||
#include "dialogs/PlaceCall.h"
|
||||
#include "ui/Avatar.h"
|
||||
|
||||
namespace dialogs {
|
||||
|
||||
PlaceCall::PlaceCall(const QString &callee, const QString &displayName, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
PlaceCall::PlaceCall(
|
||||
const QString &callee,
|
||||
const QString &displayName,
|
||||
const QString &roomName,
|
||||
const QString &avatarUrl,
|
||||
QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
setAutoFillBackground(true);
|
||||
setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);
|
||||
|
|
@ -20,25 +26,31 @@ PlaceCall::PlaceCall(const QString &callee, const QString &displayName, QWidget
|
|||
layout->setSpacing(conf::modals::WIDGET_SPACING);
|
||||
layout->setMargin(conf::modals::WIDGET_MARGIN);
|
||||
|
||||
auto buttonLayout = new QHBoxLayout();
|
||||
auto buttonLayout = new QHBoxLayout(this);
|
||||
buttonLayout->setSpacing(15);
|
||||
buttonLayout->setMargin(0);
|
||||
|
||||
QFont f;
|
||||
f.setPointSizeF(f.pointSizeF());
|
||||
auto avatar = new Avatar(this, QFontMetrics(f).height() * 3);
|
||||
if (!avatarUrl.isEmpty())
|
||||
avatar->setImage(avatarUrl);
|
||||
else
|
||||
avatar->setLetter(utils::firstChar(roomName));
|
||||
|
||||
voiceBtn_ = new QPushButton(tr("Voice Call"), this);
|
||||
voiceBtn_->setDefault(true);
|
||||
videoBtn_ = new QPushButton(tr("Video Call"), this);
|
||||
//videoBtn_ = new QPushButton(tr("Video Call"), this);
|
||||
cancelBtn_ = new QPushButton(tr("Cancel"), this);
|
||||
|
||||
buttonLayout->addStretch(1);
|
||||
buttonLayout->addWidget(avatar);
|
||||
buttonLayout->addWidget(voiceBtn_);
|
||||
buttonLayout->addWidget(videoBtn_);
|
||||
//buttonLayout->addWidget(videoBtn_);
|
||||
buttonLayout->addWidget(cancelBtn_);
|
||||
|
||||
QLabel *label;
|
||||
if (!displayName.isEmpty() && displayName != callee)
|
||||
label = new QLabel("Place a call to " + displayName + " (" + callee + ")?", this);
|
||||
else
|
||||
label = new QLabel("Place a call to " + callee + "?", this);
|
||||
QString name = displayName.isEmpty() ? callee : displayName;
|
||||
QLabel *label = new QLabel("Place a call to " + name + "?", this);
|
||||
|
||||
layout->addWidget(label);
|
||||
layout->addLayout(buttonLayout);
|
||||
|
|
@ -47,10 +59,10 @@ PlaceCall::PlaceCall(const QString &callee, const QString &displayName, QWidget
|
|||
emit voice();
|
||||
emit close();
|
||||
});
|
||||
connect(videoBtn_, &QPushButton::clicked, this, [this]() {
|
||||
/*connect(videoBtn_, &QPushButton::clicked, this, [this]() {
|
||||
emit video();
|
||||
emit close();
|
||||
});
|
||||
});*/
|
||||
connect(cancelBtn_, &QPushButton::clicked, this, [this]() {
|
||||
emit cancel();
|
||||
emit close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue