diff options
author | Camila San <hello@camila.codes> | 2018-03-15 19:21:53 +0300 |
---|---|---|
committer | Camila San <hello@camila.codes> | 2018-08-02 20:48:42 +0300 |
commit | 4ecfab4bf38c541d2c2d849c36a0b9c94733d202 (patch) | |
tree | 5180e79d32e37d10857f873b468fdb3380480043 /src/gui | |
parent | 34acc095c711f158b9deff106b2898535f899659 (diff) |
Improves share dialog.
- Removes the tabs: adds items to a vertical layout.
- Fix spacing and alignment.
- Removes extra text.
Signed-off-by: Camila San <hello@camila.codes>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/sharedialog.cpp | 8 | ||||
-rw-r--r-- | src/gui/sharedialog.ui | 12 | ||||
-rw-r--r-- | src/gui/sharelinkwidget.ui | 107 | ||||
-rw-r--r-- | src/gui/shareusergroupwidget.cpp | 7 | ||||
-rw-r--r-- | src/gui/shareusergroupwidget.ui | 53 | ||||
-rw-r--r-- | src/gui/shareuserline.ui | 12 |
6 files changed, 124 insertions, 75 deletions
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 1cca346f9..0355665ff 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -114,8 +114,6 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState, 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); - _ui->shareWidgets->hide(); return; } @@ -200,7 +198,7 @@ void ShareDialog::showSharingUi() 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); + //layout()->replaceWidget(_ui->shareWidgets, label); return; } @@ -211,14 +209,14 @@ void ShareDialog::showSharingUi() if (userGroupSharing) { _userGroupWidget = new ShareUserGroupWidget(_accountState->account(), _sharePath, _localPath, _maxSharingPermissions, _privateLinkUrl, this); - _ui->shareWidgets->addTab(_userGroupWidget, tr("Users and Groups")); + _ui->verticalLayout->addWidget(_userGroupWidget); _userGroupWidget->getShares(); } if (theme->linkSharing()) { _linkWidget = new ShareLinkWidget(_accountState->account(), _sharePath, _localPath, _maxSharingPermissions, this); _linkWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); - _ui->shareWidgets->addTab(_linkWidget, tr("Public Links")); + _ui->verticalLayout->addWidget(_linkWidget); _linkWidget->getShares(); if (_startPage == ShareDialogStartPage::PublicLinks) diff --git a/src/gui/sharedialog.ui b/src/gui/sharedialog.ui index 203dc9ea7..e7c178848 100644 --- a/src/gui/sharedialog.ui +++ b/src/gui/sharedialog.ui @@ -64,10 +64,20 @@ </layout> </item> <item> - <widget class="QTabWidget" name="shareWidgets"/> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>6</number> + </property> + </layout> </item> <item> <layout class="QHBoxLayout" name="buttonBoxLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>6</number> + </property> <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="sizePolicy"> diff --git a/src/gui/sharelinkwidget.ui b/src/gui/sharelinkwidget.ui index 5c4b2e648..e8f7905ef 100644 --- a/src/gui/sharelinkwidget.ui +++ b/src/gui/sharelinkwidget.ui @@ -14,19 +14,18 @@ <string>Share NewDocument.odt</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="publicLinkWarningLabel"> - <property name="text"> - <string>Anyone with the link has access to the file/folder</string> - </property> - <property name="textFormat"> - <enum>Qt::PlainText</enum> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> + <property name="leftMargin"> + <number>6</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_create"> <item> @@ -94,24 +93,33 @@ <property name="bottomMargin"> <number>0</number> </property> - <item row="6" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_expire"> - <property name="leftMargin"> - <number>0</number> - </property> + <item row="3" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_password"> <item> - <widget class="QCheckBox" name="checkBox_expire"> + <widget class="QCheckBox" name="checkBox_password"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> - <string>Set &expiration date</string> + <string>Set password</string> </property> </widget> </item> <item> - <widget class="QDateEdit" name="calendar"> - <property name="calendarPopup"> - <bool>true</bool> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> </item> @@ -142,36 +150,6 @@ </item> </layout> </item> - <item row="3" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_password"> - <item> - <widget class="QCheckBox" name="checkBox_password"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Set password</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> <item row="2" column="0"> <widget class="QWidget" name="widget_editing" native="true"> <layout class="QGridLayout" name="layout_editing"> @@ -291,6 +269,27 @@ </layout> </widget> </item> + <item row="6" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_expire"> + <property name="leftMargin"> + <number>0</number> + </property> + <item> + <widget class="QCheckBox" name="checkBox_expire"> + <property name="text"> + <string>Set &expiration date</string> + </property> + </widget> + </item> + <item> + <widget class="QDateEdit" name="calendar"> + <property name="calendarPopup"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> </item> diff --git a/src/gui/shareusergroupwidget.cpp b/src/gui/shareusergroupwidget.cpp index 69336f013..a1b9536ec 100644 --- a/src/gui/shareusergroupwidget.cpp +++ b/src/gui/shareusergroupwidget.cpp @@ -87,7 +87,7 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account, connect(_manager, &ShareManager::shareCreated, this, &ShareUserGroupWidget::getShares); connect(_manager, &ShareManager::serverError, this, &ShareUserGroupWidget::displayError); connect(_ui->shareeLineEdit, &QLineEdit::returnPressed, this, &ShareUserGroupWidget::slotLineEditReturn); - connect(_ui->privateLinkText, &QLabel::linkActivated, this, &ShareUserGroupWidget::slotPrivateLinkShare); + //connect(_ui->privateLinkText, &QLabel::linkActivated, this, &ShareUserGroupWidget::slotPrivateLinkShare); // By making the next two QueuedConnections we can override // the strings the completer sets on the line edit. @@ -183,6 +183,7 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>> auto layout = new QVBoxLayout(newViewPort); layout->setMargin(0); layout->setSpacing(0); + layout->setAlignment(Qt::AlignVCenter); QSize minimumSize = newViewPort->sizeHint(); int x = 0; @@ -207,7 +208,9 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>> } } if (layout->isEmpty()) { - layout->addWidget(new QLabel(tr("The item is not shared with any users or groups"))); + QLabel *notSharedYetLabel = new QLabel(tr("The item is not shared with any users or groups")); + notSharedYetLabel->setAlignment(Qt::AlignHCenter); + layout->addWidget(notSharedYetLabel); } else { layout->addStretch(1); } diff --git a/src/gui/shareusergroupwidget.ui b/src/gui/shareusergroupwidget.ui index 028d897ce..5b9b3e24e 100644 --- a/src/gui/shareusergroupwidget.ui +++ b/src/gui/shareusergroupwidget.ui @@ -14,8 +14,29 @@ <string>Share NewDocument.odt</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="leftMargin"> + <number>6</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> <item> <layout class="QHBoxLayout" name="shareeHorizontalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="sizeConstraint"> + <enum>QLayout::SetMaximumSize</enum> + </property> <item> <widget class="QLineEdit" name="shareeLineEdit"> <property name="placeholderText"> @@ -89,29 +110,35 @@ <property name="widgetResizable"> <bool>true</bool> </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> <widget class="QWidget" name="scrollAreaWidgetContents"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>377</width> - <height>169</height> + <width>383</width> + <height>201</height> </rect> </property> - <layout class="QVBoxLayout" name="verticalLayout_3"/> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="leftMargin"> + <number>6</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> + </layout> </widget> </widget> </item> - <item> - <widget class="QLabel" name="privateLinkText"> - <property name="text"> - <string><html><head/><body><p>You can direct people to this shared file or folder <a href="private link menu"><span style=" text-decoration: underline; color:#0000ff;">by giving them a private link</span></a>.</p></body></html></string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> </layout> </widget> <layoutdefault spacing="6" margin="11"/> diff --git a/src/gui/shareuserline.ui b/src/gui/shareuserline.ui index 62288a89d..8709f3626 100644 --- a/src/gui/shareuserline.ui +++ b/src/gui/shareuserline.ui @@ -20,6 +20,18 @@ <bool>true</bool> </property> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="leftMargin"> + <number>3</number> + </property> + <property name="topMargin"> + <number>3</number> + </property> + <property name="rightMargin"> + <number>3</number> + </property> + <property name="bottomMargin"> + <number>3</number> + </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> |