summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtBlockListEditorWindow.cpp3
-rw-r--r--Swift/QtUI/QtVCardWidget/QtRemovableItemDelegate.cpp2
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp3
-rw-r--r--Swift/QtUI/UserSearch/QtContactListWidget.cpp3
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