fix: better message seconds (thx to 64Gram)

This commit is contained in:
ZavaruKitsu 2023-08-01 11:23:40 +00:00
parent f9b7f42b13
commit 486e6e681c

View file

@ -470,9 +470,11 @@ void BottomInfo::layoutDateText() {
: QString();
const auto author = _data.author;
const auto prefix = !author.isEmpty() ? (author == settings->deletedMark ? u" "_q : u", "_q) : QString();
const auto date = edited + QLocale().toString(
_data.date.time(),
settings->showMessageSeconds ? QLocale::LongFormat : QLocale::ShortFormat);
const auto date = edited + QLocale().toString(
_data.date.time(),
settings->showMessageSeconds ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
: QLocale::system().timeFormat(QLocale::ShortFormat)
);
const auto afterAuthor = prefix + date;
const auto afterAuthorWidth = st::msgDateFont->width(afterAuthor);
const auto authorWidth = st::msgDateFont->width(author);