added separate display type for colours

This commit is contained in:
Marc Zinnschlag 2014-07-08 09:08:01 +02:00
parent b2ce94f28a
commit 9d5956585c
3 changed files with 5 additions and 3 deletions

View file

@ -92,7 +92,8 @@ namespace CSMWorld
Display_EnchantmentType,
Display_BodyPartType,
Display_MeshType,
Display_Gender
Display_Gender,
Display_Colour
};
int mColumnId;

View file

@ -634,7 +634,7 @@ namespace CSMWorld
{
/// \todo Replace Display_Integer with something that displays the colour value more directly.
MapColourColumn()
: Column<ESXRecordT> (Columns::ColumnId_MapColour, ColumnBase::Display_Integer)
: Column<ESXRecordT> (Columns::ColumnId_MapColour, ColumnBase::Display_Colour)
{}
virtual QVariant get (const Record<ESXRecordT>& record) const

View file

@ -145,10 +145,11 @@ QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleO
if (display != CSMWorld::ColumnBase::Display_None)
{
if (variant.type() == QVariant::Color)
if (display == CSMWorld::ColumnBase::Display_Colour)
{
return new QLineEdit(parent);
}
if (display == CSMWorld::ColumnBase::Display_Integer)
{
return new QSpinBox(parent);