mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Use name instead of "My Story" if it doesn't fit.
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user