mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
ui tweaks
This commit is contained in:
parent
3a567d962e
commit
fdee08df32
|
@ -42,8 +42,8 @@ FileTransferWidget::FileTransferWidget(QWidget *parent, ToxFile file)
|
|||
ui->filenameLabel->setText(file.fileName);
|
||||
ui->progressBar->setValue(0);
|
||||
ui->fileSizeLabel->setText(getHumanReadableSize(file.filesize));
|
||||
ui->progressLabel->setText("0%");
|
||||
ui->etaLabel->setText("--:--");
|
||||
ui->progressLabel->setText("0kiB/s");
|
||||
ui->etaLabel->setText("-:-");
|
||||
|
||||
setStyleSheet(Style::getStylesheet(":/ui/fileTransferInstance/grey.css"));
|
||||
Style::repolish(this);
|
||||
|
@ -267,10 +267,15 @@ void FileTransferWidget::handleButton(QPushButton *btn)
|
|||
|
||||
void FileTransferWidget::showPreview(const QString &filename)
|
||||
{
|
||||
//QPixmap pmap = QPixmap(filename).scaled(QSize(ui->previewLabel->maximumWidth(), maximumHeight()), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
QPixmap pmap = QPixmap(filename).scaledToWidth(ui->previewLabel->maximumWidth(), Qt::SmoothTransformation);
|
||||
ui->previewLabel->setPixmap(pmap);
|
||||
ui->previewLabel->show();
|
||||
static const QStringList previewExtensions = { "png", "jpeg", "jpg", "gif" };
|
||||
|
||||
if(previewExtensions.contains(QFileInfo(filename).suffix()))
|
||||
{
|
||||
//QPixmap pmap = QPixmap(filename).scaled(QSize(ui->previewLabel->maximumWidth(), maximumHeight()), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
QPixmap pmap = QPixmap(filename).scaledToWidth(ui->previewLabel->maximumWidth(), Qt::SmoothTransformation);
|
||||
ui->previewLabel->setPixmap(pmap);
|
||||
ui->previewLabel->show();
|
||||
}
|
||||
}
|
||||
|
||||
void FileTransferWidget::on_topButton_clicked()
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="filenameLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -101,6 +101,12 @@
|
|||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="fileSizeLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10Mb</string>
|
||||
</property>
|
||||
|
@ -111,8 +117,14 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="progressLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>24%</string>
|
||||
<string>0kb/s</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
|
@ -121,6 +133,12 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="etaLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ETA:10:10</string>
|
||||
</property>
|
||||
|
|
Loading…
Reference in New Issue
Block a user