From 61d07a19c025e138cf9a72683b4e0940d490c180 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Wed, 30 Jan 2013 01:40:34 +0100 Subject: [PATCH] Small fix for clipproperties dialog (improve column resizing in metadata and other properties) --- src/clipproperties.cpp | 4 ++++ src/clipproperties.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/clipproperties.cpp b/src/clipproperties.cpp index 9ba02d3c..c3562a93 100644 --- a/src/clipproperties.cpp +++ b/src/clipproperties.cpp @@ -499,6 +499,10 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg connect(this, SIGNAL(accepted()), this, SLOT(slotApplyProperties())); connect(m_view.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotApplyProperties())); m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false); + + m_view.metadata_list->resizeColumnToContents(0); + m_view.clip_vproperties->resizeColumnToContents(0); + m_view.clip_aproperties->resizeColumnToContents(0); adjustSize(); } diff --git a/src/clipproperties.h b/src/clipproperties.h index 690de238..075e13f0 100644 --- a/src/clipproperties.h +++ b/src/clipproperties.h @@ -33,10 +33,10 @@ class PropertiesViewDelegate : public QStyledItemDelegate Q_OBJECT public: PropertiesViewDelegate(QWidget *parent) : QStyledItemDelegate(parent) { - m_height = parent->fontMetrics().height() * 1.5; + m_height = parent->fontMetrics().height() * 1.2; } - virtual QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { - return QSize(10, m_height); + virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { + return QSize(QStyledItemDelegate::sizeHint(option, index).width(), m_height); } private: int m_height; -- 2.39.2