1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat: Add message count in tooltip to LoadHistoryDialog

This commit is contained in:
Diadlo 2017-06-25 21:26:08 +03:00
parent 23fd6962a1
commit bb65a18de5
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -24,6 +24,7 @@
#include "src/persistence/profile.h"
#include <QDate>
#include <QTextCharFormat>
#include <QCalendarWidget>
LoadHistoryDialog::LoadHistoryDialog(const ToxPk& friendPk, QWidget* parent)
: QDialog(parent)
@ -61,11 +62,12 @@ void LoadHistoryDialog::highlightDates(int year, int month)
QList<History::DateMessages> counts =
history->getChatHistoryCounts(this->friendPk, monthStart, monthEnd);
QTextCharFormat bold;
bold.setFontWeight(QFont::Bold);
QTextCharFormat format;
format.setFontWeight(QFont::Bold);
QCalendarWidget* calendar = ui->fromDate;
for (History::DateMessages p : counts) {
calendar->setDateTextFormat(monthStart.addDays(p.offsetDays), bold);
format.setToolTip(tr("%1 messages").arg(p.count));
calendar->setDateTextFormat(monthStart.addDays(p.offsetDays), format);
}
}