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