mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Use name instead of "My Story" if it doesn't fit.
This commit is contained in:
parent
5dcca4482a
commit
4b0c4eee30
2 changed files with 9 additions and 4 deletions
|
@ -347,9 +347,7 @@ Content State::next() {
|
|||
}
|
||||
result.elements.push_back({
|
||||
.id = uint64(user->id.value),
|
||||
.name = (user->isSelf()
|
||||
? tr::lng_stories_my_name(tr::now)
|
||||
: user->shortName()),
|
||||
.name = user->shortName(),
|
||||
.thumbnail = std::move(userpic),
|
||||
.count = info.count,
|
||||
.unreadCount = info.unreadCount,
|
||||
|
|
|
@ -671,7 +671,14 @@ void List::validateName(not_null<Item*> item) {
|
|||
const auto &full = _st.full;
|
||||
const auto &font = full.nameStyle.font;
|
||||
const auto available = AvailableNameWidth(_st);
|
||||
const auto text = Ui::Text::String(full.nameStyle, element.name);
|
||||
const auto my = element.skipSmall
|
||||
? tr::lng_stories_my_name(tr::now)
|
||||
: QString();
|
||||
const auto use = (my.isEmpty()
|
||||
|| full.nameStyle.font->width(my) > available)
|
||||
? element.name
|
||||
: my;
|
||||
const auto text = Ui::Text::String(full.nameStyle, use);
|
||||
const auto ratio = style::DevicePixelRatio();
|
||||
item->nameCacheColor = color->c;
|
||||
item->nameCache = QImage(
|
||||
|
|
Loading…
Add table
Reference in a new issue