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:
parent
641fc8c776
commit
de8f4a60ad
@ -456,11 +456,22 @@ void ChatLog::startResizeWorker()
|
|||||||
workerAnchorLine = visibleLines.first();
|
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;
|
workerLastIndex = 0;
|
||||||
workerTimer->start();
|
workerTimer->start();
|
||||||
|
|
||||||
// switch to busy scene displaying the busy notification
|
|
||||||
setScene(busyScene);
|
|
||||||
verticalScrollBar()->hide();
|
verticalScrollBar()->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ ChatMessage::Ptr ChatMessage::createBusyNotification()
|
|||||||
ChatMessage::Ptr msg = ChatMessage::Ptr(new ChatMessage);
|
ChatMessage::Ptr msg = ChatMessage::Ptr(new ChatMessage);
|
||||||
|
|
||||||
// TODO: Bigger font
|
// 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;
|
return msg;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user