Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat: Add message count in tooltip to LoadHistoryDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Diadlo committed Jun 26, 2017
1 parent 23fd696 commit bb65a18
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/widget/form/loadhistorydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "src/persistence/profile.h"
#include <QDate>
#include <QTextCharFormat>
#include <QCalendarWidget>

LoadHistoryDialog::LoadHistoryDialog(const ToxPk& friendPk, QWidget* parent)
: QDialog(parent)
Expand Down Expand Up @@ -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);
}
}

0 comments on commit bb65a18

Please sign in to comment.