forked from qt-creator/qt-creator
QmlDesigner: Fix shader asset icon in assets view
Fixes: QDS-9297 Change-Id: Ib81e1e12476b436dbb04984bf6f6567a88a44f63 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -35,6 +35,12 @@ const QStringList &Asset::supportedFragmentShaderSuffixes()
|
||||
return retList;
|
||||
}
|
||||
|
||||
const QStringList &Asset::supportedVertexShaderSuffixes()
|
||||
{
|
||||
static const QStringList retList {"*.vert", "*.glsl", "*.glslv", "*.vsh"};
|
||||
return retList;
|
||||
}
|
||||
|
||||
const QStringList &Asset::supportedShaderSuffixes()
|
||||
{
|
||||
static const QStringList retList {"*.frag", "*.vert",
|
||||
@@ -114,9 +120,14 @@ bool Asset::isFragmentShader() const
|
||||
return m_type == Asset::Type::FragmentShader;
|
||||
}
|
||||
|
||||
bool Asset::isVertexShader() const
|
||||
{
|
||||
return m_type == Asset::Type::VertexShader;
|
||||
}
|
||||
|
||||
bool Asset::isShader() const
|
||||
{
|
||||
return m_type == Asset::Type::Shader;
|
||||
return isFragmentShader() || isVertexShader();
|
||||
}
|
||||
|
||||
bool Asset::isFont() const
|
||||
@@ -178,8 +189,8 @@ void Asset::resolveType()
|
||||
m_type = Asset::Type::Image;
|
||||
else if (supportedFragmentShaderSuffixes().contains(m_suffix))
|
||||
m_type = Asset::Type::FragmentShader;
|
||||
else if (supportedShaderSuffixes().contains(m_suffix))
|
||||
m_type = Asset::Type::Shader;
|
||||
else if (supportedVertexShaderSuffixes().contains(m_suffix))
|
||||
m_type = Asset::Type::VertexShader;
|
||||
else if (supportedFontSuffixes().contains(m_suffix))
|
||||
m_type = Asset::Type::Font;
|
||||
else if (supportedAudioSuffixes().contains(m_suffix))
|
||||
|
@@ -14,17 +14,18 @@ public:
|
||||
Image,
|
||||
MissingImage,
|
||||
FragmentShader,
|
||||
VertexShader,
|
||||
Font,
|
||||
Audio,
|
||||
Video,
|
||||
Texture3D,
|
||||
Effect,
|
||||
Shader };
|
||||
Effect };
|
||||
|
||||
Asset(const QString &filePath);
|
||||
|
||||
static const QStringList &supportedImageSuffixes();
|
||||
static const QStringList &supportedFragmentShaderSuffixes();
|
||||
static const QStringList &supportedVertexShaderSuffixes();
|
||||
static const QStringList &supportedShaderSuffixes();
|
||||
static const QStringList &supportedFontSuffixes();
|
||||
static const QStringList &supportedAudioSuffixes();
|
||||
@@ -41,6 +42,7 @@ public:
|
||||
Type type() const;
|
||||
bool isImage() const;
|
||||
bool isFragmentShader() const;
|
||||
bool isVertexShader() const;
|
||||
bool isShader() const;
|
||||
bool isFont() const;
|
||||
bool isAudio() const;
|
||||
|
Reference in New Issue
Block a user