Browse Source

fix(alias): allow clearing alias from chatformheader

Now has the same logic as FriendWidget. Before clearing the field would result in no change being made, instead of clearing the alias.
reviewable/pr5608/r2
Anthony Bilinski 6 years ago
parent
commit
dfec934ff0
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 10
      src/widget/chatformheader.cpp
  2. 1
      src/widget/chatformheader.h

10
src/widget/chatformheader.cpp

@ -121,7 +121,7 @@ ChatFormHeader::ChatFormHeader(QWidget* parent) @@ -121,7 +121,7 @@ ChatFormHeader::ChatFormHeader(QWidget* parent)
nameLabel->setMinimumHeight(Style::getFont(Style::Medium).pixelSize());
nameLabel->setEditable(true);
nameLabel->setTextFormat(Qt::PlainText);
connect(nameLabel, &CroppingLabel::editFinished, this, &ChatFormHeader::onNameChanged);
connect(nameLabel, &CroppingLabel::editFinished, this, &ChatFormHeader::nameChanged);
headTextLayout = new QVBoxLayout();
headTextLayout->addStretch();
@ -303,11 +303,3 @@ void ChatFormHeader::addStretch() @@ -303,11 +303,3 @@ void ChatFormHeader::addStretch()
{
headTextLayout->addStretch();
}
void ChatFormHeader::onNameChanged(const QString& name)
{
if (!name.isEmpty()) {
nameLabel->setText(name);
emit nameChanged(name);
}
}

1
src/widget/chatformheader.h

@ -91,7 +91,6 @@ signals: @@ -91,7 +91,6 @@ signals:
void callRejected();
private slots:
void onNameChanged(const QString& name);
void retranslateUi();
void updateButtonsView();

Loading…
Cancel
Save