Commit 405158c3 authored by Andreas Traczyk's avatar Andreas Traczyk

mainwindow: use canonical uri for account default avatar color

Change-Id: Ib68ccc20ee85a55b49c1d3c832c2b70d41ab6482
parent 22c41e7e
......@@ -58,6 +58,7 @@ CurrentAccountComboBox::CurrentAccountComboBox(QWidget* parent)
this->setCurrentIndex(std::distance(accountList.begin(), it));
}
});
gearLabel_.setPixmap(QPixmap(":/images/icons/round-settings-24px.svg"));
gearLabel_.setParent(this);
gearLabel_.setStyleSheet("background: transparent;");
......@@ -165,8 +166,11 @@ CurrentAccountComboBox::setupSettingsButton()
void
CurrentAccountComboBox::importLabelPhoto(int index)
{
currentAccountAvatarImage_ = accountListModel_->data(accountListModel_->index(index, 0), // [efficiency improvement]
AccountListModel::Role::Picture).value<QPixmap>().scaledToHeight(avatarSize_ - 4, Qt::SmoothTransformation);
currentAccountAvatarImage_ = accountListModel_->data(
accountListModel_->index(index, 0),
AccountListModel::Role::Picture)
.value<QPixmap>()
.scaledToHeight(avatarSize_ - 4, Qt::SmoothTransformation);
}
void
......
......@@ -713,8 +713,9 @@ Utils::accountPhoto(const lrc::api::account::Info& accountInfo, const QSize& siz
auto bestId = bestIdForAccount(accountInfo);
auto bestName = bestNameForAccount(accountInfo);
QString letterStr = bestId == bestName ? QString() : QString::fromStdString(bestName);
QString prefix = accountInfo.profileInfo.type == lrc::api::profile::Type::RING ? "ring:" : "sip:";
photo = fallbackAvatar(size,
QString::fromStdString("ring:" + bestId),
prefix + QString::fromStdString(accountInfo.profileInfo.uri),
letterStr);
}
return scaleAndFrame(photo, size);
......
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