diff options
author | Tobias Markmann <tm@ayena.de> | 2013-10-18 11:54:15 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-10-26 15:37:24 (GMT) |
commit | 9720dedc1a2622a98e078b486886668b6e04ea0a (patch) | |
tree | d5284b4c377c3f03420e917f6e352f5dfe887023 /Swift/QtUI | |
parent | 08289aadf4065e1c404af50e25ed511b2e839fdb (diff) | |
download | swift-9720dedc1a2622a98e078b486886668b6e04ea0a.zip swift-9720dedc1a2622a98e078b486886668b6e04ea0a.tar.bz2 |
VCard: Add small margin to QtRemovableItemDelegate.
Change-Id: I8032c537c3e5914f43dffb4818bb00caf2ab3bbd
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtBlockListEditorWindow.cpp | 3 | ||||
-rw-r--r-- | Swift/QtUI/QtVCardWidget/QtRemovableItemDelegate.cpp | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp | 3 | ||||
-rw-r--r-- | Swift/QtUI/UserSearch/QtContactListWidget.cpp | 3 |
4 files changed, 4 insertions, 7 deletions
diff --git a/Swift/QtUI/QtBlockListEditorWindow.cpp b/Swift/QtUI/QtBlockListEditorWindow.cpp index 150b634..a759a3f 100644 --- a/Swift/QtUI/QtBlockListEditorWindow.cpp +++ b/Swift/QtUI/QtBlockListEditorWindow.cpp @@ -77,8 +77,7 @@ QtBlockListEditorWindow::QtBlockListEditorWindow() : QWidget(), ui(new Ui::QtBlo ui->blockListTreeWidget->setColumnCount(2); ui->blockListTreeWidget->header()->setStretchLastSection(false); - int closeIconWidth = style()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, 0); - ui->blockListTreeWidget->header()->resizeSection(1, closeIconWidth); + ui->blockListTreeWidget->header()->resizeSection(1, itemDelegate->sizeHint(QStyleOptionViewItem(), QModelIndex()).width()); #if QT_VERSION >= 0x050000 ui->blockListTreeWidget->header()->setSectionResizeMode(0, QHeaderView::Stretch); diff --git a/Swift/QtUI/QtVCardWidget/QtRemovableItemDelegate.cpp b/Swift/QtUI/QtVCardWidget/QtRemovableItemDelegate.cpp index e7e3175..1cae00a 100644 --- a/Swift/QtUI/QtVCardWidget/QtRemovableItemDelegate.cpp +++ b/Swift/QtUI/QtVCardWidget/QtRemovableItemDelegate.cpp @@ -48,7 +48,7 @@ bool QtRemovableItemDelegate::editorEvent(QEvent* event, QAbstractItemModel* mod } QSize QtRemovableItemDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const { - QSize size(style->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, 0), style->pixelMetric(QStyle::PM_TabCloseIndicatorHeight, 0, 0)); + QSize size(style->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, 0) + 2, style->pixelMetric(QStyle::PM_TabCloseIndicatorHeight, 0, 0) + 2); return size; } diff --git a/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp index 99e5f0b..98c8e8e 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp @@ -41,8 +41,7 @@ void QtVCardOrganizationField::setupContentWidgets() { connect(unitsTreeWidget->model(), SIGNAL(rowsRemoved(QModelIndex, int, int)), SLOT(handleRowsRemoved(QModelIndex,int,int))); unitsTreeWidget->setColumnCount(2); unitsTreeWidget->header()->setStretchLastSection(false); - int closeIconWidth = style()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, 0); - unitsTreeWidget->header()->resizeSection(1, closeIconWidth); + unitsTreeWidget->header()->resizeSection(1, itemDelegate->sizeHint(QStyleOptionViewItem(), QModelIndex()).width()); #if QT_VERSION >= 0x050000 unitsTreeWidget->header()->setSectionResizeMode(0, QHeaderView::Stretch); diff --git a/Swift/QtUI/UserSearch/QtContactListWidget.cpp b/Swift/QtUI/UserSearch/QtContactListWidget.cpp index 899c592..90adc11 100644 --- a/Swift/QtUI/UserSearch/QtContactListWidget.cpp +++ b/Swift/QtUI/UserSearch/QtContactListWidget.cpp @@ -44,8 +44,7 @@ QtContactListWidget::QtContactListWidget(QWidget* parent, SettingsProvider* sett setItemDelegateForColumn(0, contactListDelegate_); setItemDelegateForColumn(1, removableItemDelegate_); - int closeIconWidth = fontMetrics().height(); - header()->resizeSection(1, closeIconWidth); + header()->resizeSection(1, removableItemDelegate_->sizeHint(QStyleOptionViewItem(), QModelIndex()).width()); header()->setStretchLastSection(false); #if QT_VERSION >= 0x050000 |