Skip to content
Permalink
Browse files
fixed ticket #2194, icon size in tab header
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12676 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Jan 6, 2010
1 parent ec89896 commit 178108692b883a127649bf7acece737d4649d099
Showing with 6 additions and 10 deletions.
  1. +1 −1 src/plugins/grass/qgsgrassmodule.cpp
  2. +5 −9 src/plugins/grass/qgsgrasstools.cpp
@@ -994,7 +994,7 @@ QString QgsGrassModule::label( QString path )

QPixmap QgsGrassModule::pixmap( QString path, int height )
{
QgsDebugMsg( "called." );
QgsDebugMsg( QString( "path = %1" ).arg( path ) );

std::vector<QPixmap> pixmaps;

@@ -166,17 +166,13 @@ void QgsGrassTools::runModule( QString name )
QPixmap pixmap = QgsGrassModule::pixmap( path, height );

// Icon size in QT4 does not seem to be variable
// -> put smaller icons in the middle
QPixmap pixmap2( mTabWidget->iconSize() );
QPalette pal;
pixmap2.fill( pal.color( QPalette::Window ) );
QPainter painter( &pixmap2 );
int x = ( int )(( mTabWidget->iconSize().width() - pixmap.width() ) / 2 );
painter.drawPixmap( x, 0, pixmap );
painter.end();
// -> reset the width to max icon width
if ( mTabWidget->iconSize().width() < pixmap.width() ) {
mTabWidget->setIconSize( QSize( pixmap.width(), mTabWidget->iconSize().height() ) );
}

QIcon is;
is.addPixmap( pixmap2 );
is.addPixmap( pixmap );
mTabWidget->addTab( m, is, "" );


0 comments on commit 1781086

Please sign in to comment.