Adjust space between action/buttons in the toolbar.

- Minor: cleans up code used for debug.

Signed-off-by: Camila San <hello@camila.codes>
This commit is contained in:
Camila San 2018-07-11 13:34:17 +02:00 committed by Roeland Jago Douma
parent 938c99ec42
commit 9f9be7814c
No known key found for this signature in database
GPG key ID: F941078878347C0C
3 changed files with 25 additions and 21 deletions

View file

@ -91,7 +91,6 @@ ActivityWidget::ActivityWidget(AccountState *accountState, QWidget *parent)
connect(delegate, &ActivityItemDelegate::primaryButtonClickedOnItemView, this, &ActivityWidget::slotPrimaryButtonClickedOnListView);
connect(delegate, &ActivityItemDelegate::secondaryButtonClickedOnItemView, this, &ActivityWidget::slotSecondaryButtonClickedOnListView);
connect(_ui->_activityList, &QListView::activated, this, &ActivityWidget::slotOpenFile);
connect(&_removeTimer, &QTimer::timeout, this, &ActivityWidget::slotCheckToCleanWidgets);
@ -320,7 +319,6 @@ void ActivityWidget::storeActivityList(QTextStream &ts)
ActivityList activities = _model->activityList();
foreach (Activity activity, activities) {
QString message = activity._message.isEmpty()? "Message!" : activity._message;
ts << right
// account name
<< qSetFieldWidth(activity._accName.length())

View file

@ -41,6 +41,27 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="resizeMode">
<enum>QListView::Adjust</enum>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
@ -51,4 +72,4 @@
</tabstops>
<resources/>
<connections/>
</ui>
</ui>

View file

@ -43,8 +43,8 @@
namespace {
const char TOOLBAR_CSS[] =
"QToolBar { background: %1; margin: 0; padding: 0; border: none; border-bottom: 1px solid %2; spacing: 0; } "
"QToolBar QToolButton { background: %1; border: none; border-bottom: 1px solid %2; margin: 0; padding: 5px; } "
"QToolBar { background: %1; margin: 0; padding: 0; border: none; border-bottom: 0 solid %2; spacing: 0; } "
"QToolBar QToolButton { background: %1; border: none; border-bottom: 0 solid %2; margin: 0; padding: 5px; } "
"QToolBar QToolBarExtension { padding:0; } "
"QToolBar QToolButton:checked { background: %3; color: %4; }";
@ -90,7 +90,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
_actionGroup = new QActionGroup(this);
_actionGroup->setExclusive(true);
connect(_actionGroup, &QActionGroup::triggered, this, &SettingsDialog::slotSwitchPage);
foreach(auto ai, AccountManager::instance()->accounts()) {
@ -111,7 +110,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
_toolBar->addAction(generalAction);
GeneralSettings *generalSettings = new GeneralSettings;
_ui->stack->addWidget(generalSettings);
_actionBefore = generalAction;
QAction *networkAction = createColorAwareAction(QLatin1String(":/client/resources/network.png"), tr("Network"));
_actionGroup->addAction(networkAction);
@ -257,10 +255,6 @@ void SettingsDialog::accountAdded(AccountState *s)
connect(s, &AccountState::isConnectedChanged, this, &SettingsDialog::slotRefreshActivityAccountStateSender);
activityAdded(s);
QWidget* spacer = new QWidget();
spacer->setMinimumWidth(30);
spacer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
_toolBar->insertWidget(_actionBefore, spacer);
slotRefreshActivity(s);
}
@ -313,16 +307,6 @@ void SettingsDialog::accountRemoved(AccountState *s)
}
}
// _ui->stack->insertWidget(0, accountSettings);
// _actionGroup->addAction(accountAction);
// _actionGroupWidgets.insert(accountAction, accountSettings);
// _actionForAccount.insert(s->account().data(), accountAction);
// _toolBar->insertSeparator(_actionBefore);
// _toolBar->insertAction(_actionBefore, action);
// _actionGroup->addAction(action);
// _actionGroupWidgets.insert(action, _activitySettings[s]);
if (_actionForAccount.contains(s->account().data())) {
_actionForAccount.remove(s->account().data());
}
@ -336,6 +320,7 @@ void SettingsDialog::accountRemoved(AccountState *s)
_actionGroupWidgets.remove(action);
_toolBar->removeAction(action);
}
_toolBar->widgetForAction(_actionBefore)->hide();
_activitySettings.remove(s);
}