summary refs log tree commit diff
path: root/src/dialogs/ReadReceipts.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2020-06-09 20:51:36 -0400
committerJoseph Donofry <joedonofry@gmail.com>2020-06-09 20:51:36 -0400
commit6bb73f84a3075abe7a1c1fd2d56a259740070c70 (patch)
treeeecb0bc3ec18a04cd226d1caea74b2b65ef6d851 /src/dialogs/ReadReceipts.cpp
parentMinor adjustments to emoji picker (diff)
parentSmooth scaling for images (diff)
downloadnheko-6bb73f84a3075abe7a1c1fd2d56a259740070c70.tar.xz
Merge master and fix conflicts
Diffstat (limited to 'src/dialogs/ReadReceipts.cpp')
-rw-r--r--src/dialogs/ReadReceipts.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/dialogs/ReadReceipts.cpp b/src/dialogs/ReadReceipts.cpp

index 0edd1ebf..7dcffc28 100644 --- a/src/dialogs/ReadReceipts.cpp +++ b/src/dialogs/ReadReceipts.cpp
@@ -1,5 +1,6 @@ #include <QDebug> #include <QIcon> +#include <QLabel> #include <QListWidgetItem> #include <QPainter> #include <QPushButton> @@ -74,15 +75,17 @@ ReceiptItem::dateFormat(const QDateTime &then) const auto days = then.daysTo(now); if (days == 0) - return tr("Today %1").arg(then.time().toString(Qt::DefaultLocaleShortDate)); + return tr("Today %1") + .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat)); else if (days < 2) - return tr("Yesterday %1").arg(then.time().toString(Qt::DefaultLocaleShortDate)); + return tr("Yesterday %1") + .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat)); else if (days < 7) return QString("%1 %2") .arg(then.toString("dddd")) - .arg(then.time().toString(Qt::DefaultLocaleShortDate)); + .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat)); - return then.toString(Qt::DefaultLocaleShortDate); + return QLocale::system().toString(then.time(), QLocale::ShortFormat); } ReadReceipts::ReadReceipts(QWidget *parent) @@ -163,3 +166,10 @@ ReadReceipts::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } + +void +ReadReceipts::hideEvent(QHideEvent *event) +{ + userList_->clear(); + QFrame::hideEvent(event); +}