Commit 3c584d0b authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

EffectStack: Improving the layout.

parent 5adb5d90
......@@ -23,6 +23,11 @@
#include "EffectInstanceListModel.h"
#include "EffectInstance.h"
#include <QApplication>
#include <QFontMetrics>
#include <QtDebug>
EffectInstanceListModel::EffectInstanceListModel( EffectsEngine::EffectList *list ) :
m_list( list )
{
......@@ -45,6 +50,12 @@ EffectInstanceListModel::data( const QModelIndex &index, int role ) const
return m_list->at( index.row() )->effect->effect()->description();
case Qt::EditRole:
return QVariant::fromValue( m_list->at( index.row() ) );
case Qt::SizeHintRole:
{
const QFontMetrics &fm = QApplication::fontMetrics();
QSize size( fm.width( m_list->at( index.row() )->effect->effect()->name() ), fm.height() );
return size;
}
default:
return QVariant();
}
......
......@@ -54,7 +54,7 @@
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="authorValueLabel">
<widget class="ExtendedLabel" name="authorValueLabel">
<property name="text">
<string/>
</property>
......@@ -122,7 +122,7 @@
<string/>
</property>
<property name="wordWrap">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -159,6 +159,12 @@
<height>147</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QFormLayout" name="settingsLayout"/>
......@@ -200,6 +206,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ExtendedLabel</class>
<extends>QLabel</extends>
<header>ExtendedLabel.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../../../resources.qrc"/>
</resources>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment