Skip to content
Permalink
Browse files

better icons

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5045 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 17, 2006
1 parent 5e24366 commit ac072559f25f8bd9b498dceb96afde2ea7678e08
Showing with 43 additions and 4 deletions.
  1. +38 −4 src/plugins/grass/qgsgrassmodel.cpp
  2. +5 −0 src/plugins/grass/qgsgrassmodel.h
@@ -484,6 +484,13 @@ QgsGrassModel::QgsGrassModel ( QObject * parent )
+ "/" + QgsGrass::getDefaultLocation();

mIconFile = QIcon(style->standardPixmap(QStyle::SP_FileIcon));

QString iconPath = QgsApplication::themePath();
mIconPointLayer = QIcon ( iconPath+"/mIconPointLayer.png" );
mIconLineLayer = QIcon ( iconPath+"/mIconLineLayer.png" );
mIconPolygonLayer = QIcon ( iconPath+"/mIconPolygonLayer.png" );
mIconVectorLayer = QIcon ( iconPath+"/grass/grass_browser_vector_layer.png" );
mIconRasterLayer = QIcon ( iconPath+"/grass/grass_browser_raster_layer.png" );

mRoot = new QgsGrassModelItem();
mRoot->mType = QgsGrassModel::Location;
@@ -784,10 +791,37 @@ QVariant QgsGrassModel::data ( const QModelIndex &index, int role ) const

if ( role == Qt::DecorationRole )
{
if ( item->type() == QgsGrassModel::Raster ||
item->type() == QgsGrassModel::VectorLayer )
{
return mIconFile;
switch ( item->type() )
{
case QgsGrassModel::Vector :
return mIconVectorLayer;
break;

case QgsGrassModel::Raster :
return mIconRasterLayer;
break;

case QgsGrassModel::VectorLayer :
if ( item->mLayer.contains("point") )
{
return mIconPointLayer;
}
else if ( item->mLayer.contains("line") )
{
return mIconLineLayer;
}
else if ( item->mLayer.contains("polygon") )
{
return mIconPolygonLayer;
}
else
{
return mIconFile;
}
break;

default:
return mIconDirectory;
}
return mIconDirectory;
}
@@ -112,6 +112,11 @@ class QgsGrassModel: public QAbstractItemModel
//! Icons
QIcon mIconDirectory;
QIcon mIconFile;
QIcon mIconRasterLayer;
QIcon mIconVectorLayer;
QIcon mIconPointLayer;
QIcon mIconLineLayer;
QIcon mIconPolygonLayer;
};

#endif // QGSGRASSMODEL_H

0 comments on commit ac07255

Please sign in to comment.
You can’t perform that action at this time.