Share dialog: Hide the icon when unused
authorChristian Kamm <mail@ckamm.de>
Fri, 19 May 2017 07:48:47 +0000 (09:48 +0200)
committerckamm <mail@ckamm.de>
Mon, 22 May 2017 08:52:52 +0000 (10:52 +0200)
Previously this used up some space when there was no icon, leading
to an oddly indented header.

src/gui/sharedialog.cpp

index 60d6167d41397612201d03c5338a43744d09d0e8..c545169e45447aad772eed5e148abef920e7672c 100644 (file)
@@ -107,6 +107,7 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
         return;
     }
 
+    _ui->label_icon->hide();
     if (QFileInfo(_localPath).isFile()) {
         ThumbnailJob *job = new ThumbnailJob(_sharePath, _accountState->account(), this);
         connect(job, SIGNAL(jobFinished(int, QByteArray)), SLOT(slotThumbnailFetched(int, QByteArray)));
@@ -217,6 +218,7 @@ void ShareDialog::slotThumbnailFetched(const int &statusCode, const QByteArray &
     p.loadFromData(reply, "PNG");
     p = p.scaledToHeight(thumbnailSize, Qt::SmoothTransformation);
     _ui->label_icon->setPixmap(p);
+    _ui->label_icon->show();
 }
 
 void ShareDialog::slotAccountStateChanged(int state)