Skip to content
Permalink
Browse files

adjusted GRASS list GUI

git-svn-id: http://svn.osgeo.org/qgis/trunk@14621 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler
brushtyler committed Nov 13, 2010
1 parent 899a11d commit 9a91aa499ddad021a6880772b2e58b72e976cded
@@ -173,7 +173,7 @@ FILE (GLOB GMLS *.gml)
INSTALL (FILES ${GMLS} images/world.png
DESTINATION ${QGIS_DATA_DIR}/grass)

INSTALL (FILES themes/gis/grass_arrow.png themes/gis/grass_plus.png
INSTALL (FILES themes/gis/grass_arrow.svg themes/gis/grass_plus.svg themes/gis/grass_arrow.png themes/gis/grass_plus.png
DESTINATION ${QGIS_DATA_DIR}/grass/modules)

INSTALL(TARGETS qgis.g.browser
@@ -1130,20 +1130,59 @@ QPixmap QgsGrassModule::pixmap( QString path, int height )
img = img.scaled( arrowWidth, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
arrowPixmap = QPixmap::fromImage( img );
}
/*if ( iconsfi.exists() )
{
QSvgRenderer pic;
if ( pic.load( arrowPath ) )
{
QRect br( QPoint( 0, 0 ), pic.defaultSize() );
double scale = 1. * height / br.height();
arrowWidth = ( int )( scale * br.width() );
if ( arrowWidth <= 0 ) arrowWidth = height; // should not happen
arrowPixmap = QPixmap( arrowWidth, height );
arrowPixmap.fill( Qt::transparent );
QPainter painter( &arrowPixmap );
painter.setRenderHint( QPainter::Antialiasing );
pic.render( &painter );
painter.end();
}
}*/

QString plusPath = iconsPath + "grass_plus.png";
QString plusPath = iconsPath + "grass_plus.svg";
QPixmap plusPixmap;
iconsfi.setFile( plusPath );
if ( iconsfi.exists() && plusPixmap.load( plusPath, "PNG" ) )
/*if ( iconsfi.exists() && plusPixmap.load( plusPath, "PNG" ) )
{
double scale = 1. * height / plusPixmap.height();
plusWidth = ( int )( scale * plusPixmap.width() );
QImage img = plusPixmap.toImage();
img = img.scaled( plusWidth, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
plusPixmap = QPixmap::fromImage( img );
}
}*/
if ( iconsfi.exists() )
{
QSvgRenderer pic;
if ( pic.load( plusPath ) )
{
QRect br( QPoint( 0, 0 ), pic.defaultSize() );

double scale = 1. * height / br.height();

plusWidth = ( int )( scale * br.width() );
if ( plusWidth <= 0 ) plusWidth = height; // should not happen
plusPixmap = QPixmap( plusWidth, height );
plusPixmap.fill( Qt::transparent );
QPainter painter( &plusPixmap );
painter.setRenderHint( QPainter::Antialiasing );

pic.render( &painter );
painter.end();
}
}
int buffer = height/3; // buffer around a sign
if ( pixmaps.size() > 1 ) width += arrowWidth + 2 * buffer; // ->
if ( pixmaps.size() > 2 ) width += plusWidth + 2 * buffer; // +
@@ -78,7 +78,7 @@ QgsGrassTools::QgsGrassTools( QgisInterface *iface,
mModelProxy->setFilterRole( Qt::UserRole + 2 );

mListView->setModel( mModelProxy );
mListView->setItemDelegateForColumn( 0, new QgsDetailedItemDelegate() );
//mListView->setItemDelegateForColumn( 0, new QgsDetailedItemDelegate() );
//mListView->setUniformItemSizes( false );
//mListView2 = new QListView(this);
//mDockWidget = new QDockWidget(tr("Grass Tools"), 0);
@@ -302,7 +302,7 @@ void QgsGrassTools::addModules( QTreeWidgetItem *parent, QDomElement &element )
//
// Experimental work by Tim - add this item to our list model
//
QStandardItem * mypDetailItem = new QStandardItem( name );
QStandardItem * mypDetailItem = new QStandardItem( name + "\n" + label );
mypDetailItem->setData( name, Qt::UserRole + 1 ); //for calling runModule later
QString mySearchText = name + " - " + label;
mypDetailItem->setData( mySearchText, Qt::UserRole + 2 ); //for filtering later
@@ -19,7 +19,7 @@
<property name="windowTitle">
<string>Grass Tools</string>
</property>
<layout class="QGridLayout">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTabWidget" name="mTabWidget">
<property name="currentIndex">
@@ -54,17 +54,30 @@
<attribute name="title">
<string>Modules List</string>
</attribute>
<layout class="QGridLayout">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Filter</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mFilterInput"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QListView" name="mListView">
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="mFilterInput"/>
</item>
</layout>
</widget>
</widget>
@@ -28,7 +28,7 @@
<g
id="layer1">
<path
d="m 18.5,8.5 0,5 -10,0 c -0.554,0 -1,0.446 -1,1 l 0,2 c 0,0.554 0.446,1 1,1 l 10,0 0,5 9,-7 -9,-7 z"
d="m 13.5,13.5 -5,0 c -0.554,0 -1,0.446 -1,1 l 0,2 c 0,0.554 0.446,1 1,1 l 10,0 0,5 9,-7 -9,-7 0,5 -4.955446,0"
id="path2984"
style="color:#000000;fill:#e9b96e;fill-opacity:1;fill-rule:nonzero;stroke:#c17d11;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>

0 comments on commit 9a91aa4

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