mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
ShareDialog: remove the "Premissions" label and adjust the size of the scrollarea (#3737)
This commit is contained in:
parent
575fc9acbd
commit
d6aa667971
3 changed files with 24 additions and 3 deletions
|
@ -141,11 +141,14 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>>
|
|||
}
|
||||
|
||||
ShareWidget *s = new ShareWidget(share, _ui->scrollArea);
|
||||
connect(s, SIGNAL(resizeRequested()), this, SLOT(slotAdjustScrollWidgetSize()));
|
||||
layout->addWidget(s);
|
||||
|
||||
x++;
|
||||
if (x <= 3) {
|
||||
minimumSize = newViewPort->sizeHint();
|
||||
} else {
|
||||
minimumSize.rwidth() = qMax(newViewPort->sizeHint().width(), minimumSize.width());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,6 +159,19 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>>
|
|||
scrollArea->setWidget(newViewPort);
|
||||
}
|
||||
|
||||
void ShareUserGroupWidget::slotAdjustScrollWidgetSize()
|
||||
{
|
||||
QScrollArea *scrollArea = _ui->scrollArea;
|
||||
if (scrollArea->findChildren<ShareWidget*>().count() <= 3) {
|
||||
auto minimumSize = scrollArea->widget()->sizeHint();
|
||||
auto spacing = scrollArea->widget()->layout()->spacing();
|
||||
minimumSize.rwidth() += spacing;
|
||||
minimumSize.rheight() += spacing;
|
||||
scrollArea->setMinimumSize(minimumSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShareUserGroupWidget::slotShareesReady()
|
||||
{
|
||||
_completer->complete();
|
||||
|
@ -226,6 +242,7 @@ void ShareWidget::on_permissionToggleButton_clicked()
|
|||
} else {
|
||||
_ui->permissionToggleButton->setText("More");
|
||||
}
|
||||
emit resizeRequested();
|
||||
}
|
||||
|
||||
ShareWidget::~ShareWidget()
|
||||
|
@ -279,6 +296,7 @@ void ShareWidget::slotPermissionsChanged()
|
|||
|
||||
void ShareWidget::slotDeleteAnimationFinished()
|
||||
{
|
||||
resizeRequested();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
@ -291,6 +309,7 @@ void ShareWidget::slotShareDeleted()
|
|||
animation->setEndValue(0);
|
||||
|
||||
connect(animation, SIGNAL(finished()), SLOT(slotDeleteAnimationFinished()));
|
||||
connect(animation, SIGNAL(valueChanged(QVariant)), this, SIGNAL(resizeRequested()));
|
||||
|
||||
animation->start();
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
|
||||
signals:
|
||||
void shareDeleted(ShareWidget *share);
|
||||
void resizeRequested();
|
||||
|
||||
private slots:
|
||||
void on_deleteShareButton_clicked();
|
||||
|
@ -102,6 +103,7 @@ private slots:
|
|||
|
||||
void slotCompleterActivated(const QModelIndex & index);
|
||||
void slotShareesReady();
|
||||
void slotAdjustScrollWidgetSize();
|
||||
|
||||
private:
|
||||
Ui::ShareUserGroupWidget *_ui;
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>474</width>
|
||||
<height>108</height>
|
||||
<width>468</width>
|
||||
<height>92</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -54,7 +54,7 @@
|
|||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Permissions</string>
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
|
|
Loading…
Reference in a new issue