mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(groups): Correct color of labels in group call
Group calls are supposed to show the name of each member under their avatars. The color of the text was previously fixed to white regardless of the background ignoring the color of the background. This fix ensures that the background color is not the same color as the label text
This commit is contained in:
parent
d4d4308e28
commit
f27eb5b76c
|
@ -37,7 +37,7 @@
|
|||
class LabeledVideo : public QFrame
|
||||
{
|
||||
public:
|
||||
LabeledVideo(const QPixmap& avatar, QWidget* parent = nullptr, bool expanding = true)
|
||||
LabeledVideo(const QPixmap& avatar, QString fontColorString, QWidget* parent = nullptr, bool expanding = true)
|
||||
: QFrame(parent)
|
||||
{
|
||||
qDebug() << "Created expanding? " << expanding;
|
||||
|
@ -48,7 +48,7 @@ public:
|
|||
connect(videoSurface, &VideoSurface::ratioChanged, this, &LabeledVideo::updateSize);
|
||||
label = new CroppingLabel(this);
|
||||
label->setTextFormat(Qt::PlainText);
|
||||
label->setStyleSheet("color: white");
|
||||
label->setStyleSheet(QString("color: %1").arg(fontColorString));
|
||||
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
|
||||
|
@ -108,7 +108,7 @@ GroupNetCamView::GroupNetCamView(int group, QWidget* parent)
|
|||
: GenericNetCamView(parent)
|
||||
, group(group)
|
||||
{
|
||||
videoLabelSurface = new LabeledVideo(QPixmap(), this, false);
|
||||
videoLabelSurface = new LabeledVideo(QPixmap(), "white", this, false);
|
||||
videoSurface = videoLabelSurface->getVideoSurface();
|
||||
videoSurface->setMinimumHeight(256);
|
||||
videoSurface->setContentsMargins(6, 6, 6, 0);
|
||||
|
@ -139,7 +139,7 @@ GroupNetCamView::GroupNetCamView(int group, QWidget* parent)
|
|||
horLayout = new QHBoxLayout(widget);
|
||||
horLayout->addStretch(1);
|
||||
|
||||
selfVideoSurface = new LabeledVideo(Nexus::getProfile()->loadAvatar(), this);
|
||||
selfVideoSurface = new LabeledVideo(Nexus::getProfile()->loadAvatar(), "black", this);
|
||||
horLayout->addWidget(selfVideoSurface);
|
||||
|
||||
horLayout->addStretch(1);
|
||||
|
@ -176,7 +176,7 @@ void GroupNetCamView::clearPeers()
|
|||
void GroupNetCamView::addPeer(const ToxPk& peer, const QString& name)
|
||||
{
|
||||
QPixmap groupAvatar = Nexus::getProfile()->loadAvatar(peer);
|
||||
LabeledVideo* labeledVideo = new LabeledVideo(groupAvatar, this);
|
||||
LabeledVideo* labeledVideo = new LabeledVideo(groupAvatar, "black", this);
|
||||
labeledVideo->setText(name);
|
||||
horLayout->insertWidget(horLayout->count() - 1, labeledVideo);
|
||||
PeerVideo peerVideo;
|
||||
|
|
Loading…
Reference in New Issue
Block a user