зеркало из https://github.com/nextcloud/desktop.git
ShareUserLine: fix eliding
The widget doesn't have its final size at construction time, so the width for eliding is not yet known. Let ElidedLabel do the job.
This commit is contained in:
Родитель
b546e7c224
Коммит
fae1c0dbdd
|
@ -371,10 +371,8 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
|
|||
{
|
||||
_ui->setupUi(this);
|
||||
|
||||
QString sharedWithText(share->getShareWith()->format());
|
||||
QFontMetrics metrics(_ui->sharedWith->font());
|
||||
QString elidedText = metrics.elidedText(sharedWithText, Qt::ElideRight, _ui->sharedWith->width());
|
||||
_ui->sharedWith->setText(elidedText);
|
||||
_ui->sharedWith->setElideMode(Qt::ElideRight);
|
||||
_ui->sharedWith->setText(share->getShareWith()->format());
|
||||
|
||||
// adds permissions
|
||||
// can edit permission
|
||||
|
|
|
@ -97,9 +97,9 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="sharedWith">
|
||||
<widget class="OCC::ElidedLabel" name="sharedWith">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<sizepolicy hsizetype="Ignored" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -204,6 +204,13 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>OCC::ElidedLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>elidedlabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../client.qrc"/>
|
||||
</resources>
|
||||
|
|
Загрузка…
Ссылка в новой задаче