Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed ticket #2194, icon size in tab header
git-svn-id: http://svn.osgeo.org/qgis/trunk@12676 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Jan 6, 2010
1 parent 8fa0f54 commit 729153b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -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;

Expand Down
14 changes: 5 additions & 9 deletions src/plugins/grass/qgsgrasstools.cpp
Expand Up @@ -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, "" );


Expand Down

0 comments on commit 729153b

Please sign in to comment.