mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
rewrite
This commit is contained in:
parent
0fe14953c8
commit
92b2848916
|
@ -213,6 +213,8 @@ QString FileTransferInstance::getHtmlImage()
|
|||
return ba.toBase64();
|
||||
};
|
||||
|
||||
QString widgetId = QString::number(getId());
|
||||
|
||||
QString res;
|
||||
if (state == tsPending || state == tsProcessing || state == tsPaused)
|
||||
{
|
||||
|
@ -223,29 +225,55 @@ QString FileTransferInstance::getHtmlImage()
|
|||
else
|
||||
rightDown = QImage(":ui/acceptFileButton/default.png");
|
||||
|
||||
QString widgetId = QString::number(getId());
|
||||
QString strUp = "<img src=\"data:ftrans." + widgetId + ".top/png;base64," + QImage2base64(rightUp) + "\">";
|
||||
QString strDown = "<img src=\"data:ftrans." + widgetId + ".bottom/png;base64," + QImage2base64(rightDown) + "\">";
|
||||
|
||||
res = "<table widht=100% cellspacing=\"2\">\n";
|
||||
res += "<tr>\n<td width=100%>\n";
|
||||
res += "<div class=green><p>" + filename + "</p><p>" + getHumanReadableSize(lastBytesSent) + "/" + size;
|
||||
res += " (" + speed + ")</p></div>\n";
|
||||
res += "</td>\n<td>\n";
|
||||
res += "<table cellspacing=\"0\"><tr valign=top><td>" + strUp + "</td></tr><tr valign=bottom><td>" + strDown + "</td></tr></table>\n";
|
||||
res += "</td>\n</tr>\n";
|
||||
res = "<table widht=100% cellspacing=\"2\">\n";
|
||||
res += "<tr valign=middle>\n";
|
||||
res += "<td>\n";
|
||||
res += "<div class=button>" + strUp + "</div>\n";
|
||||
res += "</td>\n";
|
||||
if (pic != QImage())
|
||||
{
|
||||
res += "<td>\n";
|
||||
res += "<img src=\"data:mini." + widgetId + "/png;base64," + QImage2base64(pic) + "\">";
|
||||
res += "</td>\n";
|
||||
}
|
||||
res += "<td width=100%>\n";
|
||||
res += "<div class=green>";
|
||||
res += "<p>" + filename + "</p>";
|
||||
res += "<p>" + getHumanReadableSize(lastBytesSent) + " / " + size; + " (" + speed + ")</p>\n";
|
||||
res += "</div>\n";
|
||||
res += "</td>\n";
|
||||
res += "<td>\n";
|
||||
res += "<div class=button>" + strDown + "</div>\n";
|
||||
res += "</td>\n";
|
||||
res += "</tr>\n";
|
||||
res += "</table>\n";
|
||||
|
||||
} else if (state == tsCanceled)
|
||||
{
|
||||
res = "<table widht=100% cellspacing=\"2\">\n";
|
||||
res += "<tr>\n<td width=100%>\n";
|
||||
res = "<table widht=100% cellspacing=\"2\">\n<tr>\n";
|
||||
if (pic != QImage())
|
||||
{
|
||||
res += "<td>\n";
|
||||
res += "<img src=\"data:mini." + widgetId + "/png;base64," + QImage2base64(pic) + "\">";
|
||||
res += "</td>\n";
|
||||
}
|
||||
res += "<td width=100%>\n";
|
||||
res += "<div class=red><p>" + filename + "</p><p>" + size + "</p></div>\n";
|
||||
res += "</td>\n</tr>\n";
|
||||
res += "</table>\n";
|
||||
} else if (state == tsFinished)
|
||||
{
|
||||
res = "<table widht=100% cellspacing=\"2\">\n";
|
||||
res += "<tr>\n<td width=100%>\n";
|
||||
res = "<table widht=100% cellspacing=\"2\">\n<tr>\n";
|
||||
if (pic != QImage())
|
||||
{
|
||||
res += "<td>\n";
|
||||
res += "<img src=\"data:mini." + widgetId + "/png;base64," + QImage2base64(pic) + "\">";
|
||||
res += "</td>\n";
|
||||
}
|
||||
res += "<td width=100%>\n";
|
||||
res += "<div class=green><p>" + filename + "</p><p>" + size + "</p></div>\n";
|
||||
res += "</td>\n</tr>\n";
|
||||
res += "</table>\n";
|
||||
|
|
|
@ -45,6 +45,14 @@ div.green {
|
|||
font-size: 10px;
|
||||
}
|
||||
|
||||
div.button {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 0px;
|
||||
color: #ffffff;
|
||||
background-color: #6bc260;
|
||||
}
|
||||
|
||||
div.red {
|
||||
margin-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
|
|
Loading…
Reference in New Issue
Block a user