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> </translation>
</message> </message>
<message> <message>
<location filename="src/ui/ChatWindow.cpp" line="153"/> <location filename="src/ui/ChatWindow.cpp" line="155"/>
<source>%1 online now:</source> <source>%1 online now:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View file

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