Prevented empty time stamps - when less then a minute has passed - from

appearing.
This commit is contained in:
Dimitar Dobrev 2014-03-11 19:26:14 +02:00
parent 858e9fa7df
commit fe2f9f5253
2 changed files with 10 additions and 8 deletions

View file

@ -76,7 +76,7 @@
</translation>
</message>
<message>
<location filename="src/ui/ChatWindow.cpp" line="153"/>
<location filename="src/ui/ChatWindow.cpp" line="155"/>
<source>%1 online now:</source>
<translation type="unfinished"></translation>
</message>

View file

@ -109,13 +109,15 @@ void ChatWindow::addTimeStamp() {
}
}
timeString.chop(1);
QLabel* timeLabel = new QLabel(timeString);
timeLabel->setStyleSheet("color: palette(shadow);"
"background-color: palette(highlight);"
"padding: 4px;");
timeLabel->setAlignment(Qt::AlignHCenter);
ui->messagesFormLayout->addRow(timeLabel);
numMessagesAfterLastTimeStamp = 0;
if (!timeString.isEmpty()) {
QLabel* timeLabel = new QLabel(timeString);
timeLabel->setStyleSheet("color: palette(shadow);"
"background-color: palette(highlight);"
"padding: 4px;");
timeLabel->setAlignment(Qt::AlignHCenter);
ui->messagesFormLayout->addRow(timeLabel);
numMessagesAfterLastTimeStamp = 0;
}
}
void ChatWindow::startTimerForTimeStamps() {