2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Added support of second colors for empty userpic backgrounds.

This commit is contained in:
23rd
2022-12-03 18:57:15 +03:00
parent c8d273c2a3
commit 5df0b08a42
11 changed files with 96 additions and 49 deletions

View File

@@ -69,20 +69,6 @@ int PeerColorIndex(PeerId peerId) {
return PeerColorIndex(peerId.value & PeerId::kChatTypeMask);
}
style::color PeerUserpicColor(PeerId peerId) {
const style::color colors[] = {
st::historyPeer1UserpicBg,
st::historyPeer2UserpicBg,
st::historyPeer3UserpicBg,
st::historyPeer4UserpicBg,
st::historyPeer5UserpicBg,
st::historyPeer6UserpicBg,
st::historyPeer7UserpicBg,
st::historyPeer8UserpicBg,
};
return colors[PeerColorIndex(peerId)];
}
PeerId FakePeerIdForJustName(const QString &name) {
constexpr auto kShift = (0xFEULL << 32);
const auto base = name.isEmpty()
@@ -250,7 +236,7 @@ not_null<Ui::EmptyUserpic*> PeerData::ensureEmptyUserpic() const {
if (!_userpicEmpty) {
const auto user = asUser();
_userpicEmpty = std::make_unique<Ui::EmptyUserpic>(
Data::PeerUserpicColor(id),
Ui::PeerUserpicColor(id),
user && user->isInaccessible()
? Ui::EmptyUserpic::InaccessibleName()
: name());