[QGIS Commit] r12676 - trunk/qgis/src/plugins/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Jan 6 03:32:15 EST 2010


Author: rblazek
Date: 2010-01-06 03:32:13 -0500 (Wed, 06 Jan 2010)
New Revision: 12676

Modified:
   trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
   trunk/qgis/src/plugins/grass/qgsgrasstools.cpp
Log:
fixed ticket #2194, icon size in tab header

Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2010-01-05 21:02:16 UTC (rev 12675)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2010-01-06 08:32:13 UTC (rev 12676)
@@ -994,7 +994,7 @@
 
 QPixmap QgsGrassModule::pixmap( QString path, int height )
 {
-  QgsDebugMsg( "called." );
+  QgsDebugMsg( QString( "path = %1" ).arg( path ) );
 
   std::vector<QPixmap> pixmaps;
 

Modified: trunk/qgis/src/plugins/grass/qgsgrasstools.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrasstools.cpp	2010-01-05 21:02:16 UTC (rev 12675)
+++ trunk/qgis/src/plugins/grass/qgsgrasstools.cpp	2010-01-06 08:32:13 UTC (rev 12676)
@@ -166,17 +166,13 @@
   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, "" );
 
 



More information about the QGIS-commit mailing list