Sharing dialog: Ensure error labels are expanding #5774
authorChristian Kamm <mail@ckamm.de>
Fri, 19 May 2017 07:49:24 +0000 (09:49 +0200)
committerckamm <mail@ckamm.de>
Mon, 22 May 2017 08:52:52 +0000 (10:52 +0200)
src/gui/sharedialog.cpp

index c545169e45447aad772eed5e148abef920e7672c..05cc7b7914837906f2db93616c5e96dc5bdbff5c 100644 (file)
@@ -102,8 +102,10 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
     this->setWindowTitle(tr("%1 Sharing").arg(Theme::instance()->appNameGUI()));
 
     if (!accountState->account()->capabilities().shareAPI()) {
-        _ui->shareWidgets->hide();
-        layout()->replaceWidget(_ui->shareWidgets, new QLabel(tr("The server does not allow sharing")));
+        auto label = new QLabel(tr("The server does not allow sharing"));
+        label->setWordWrap(true);
+        label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+        layout()->replaceWidget(_ui->shareWidgets, label);
         return;
     }
 
@@ -175,6 +177,7 @@ void ShareDialog::showSharingUi()
         auto label = new QLabel(this);
         label->setText(tr("The file can not be shared because it was shared without sharing permission."));
         label->setWordWrap(true);
+        label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
         layout()->replaceWidget(_ui->shareWidgets, label);
         return;
     }