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

Resize notification only if theres lot of text

This commit is contained in:
kushagra 2015-03-08 11:01:21 +05:30
parent 641fc8c776
commit de8f4a60ad
2 changed files with 14 additions and 3 deletions

View File

@ -456,11 +456,22 @@ void ChatLog::startResizeWorker()
workerAnchorLine = visibleLines.first();
}
// switch to busy scene displaying the busy notification if there is a lot
// of text to be resized
int txt = 0;
for(ChatLine::Ptr line : lines)
{
if(txt>500000)
break;
for(ChatLineContent* content : line->content)
txt += content->getText().size();
}
if(txt>500000)
setScene(busyScene);
workerLastIndex = 0;
workerTimer->start();
// switch to busy scene displaying the busy notification
setScene(busyScene);
verticalScrollBar()->hide();
}

View File

@ -123,7 +123,7 @@ ChatMessage::Ptr ChatMessage::createBusyNotification()
ChatMessage::Ptr msg = ChatMessage::Ptr(new ChatMessage);
// TODO: Bigger font
msg->addColumn(new Text(QObject::tr("Busy..."), Style::getFont(Style::ExtraBig), false, ""), ColumnFormat(1.0, ColumnFormat::VariableSize, ColumnFormat::Center));
msg->addColumn(new Text(QObject::tr("Resizing"), Style::getFont(Style::ExtraBig), false, ""), ColumnFormat(1.0, ColumnFormat::VariableSize, ColumnFormat::Center));
return msg;
}