summaryrefslogtreecommitdiff
path: root/library/resource.h
Unidiff
Diffstat (limited to 'library/resource.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/resource.h33
1 files changed, 5 insertions, 28 deletions
diff --git a/library/resource.h b/library/resource.h
index 982c58a..1f1ba9a 100644
--- a/library/resource.h
+++ b/library/resource.h
@@ -1,5 +1,5 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -47,30 +47,7 @@ inline QIconSet Resource::loadIconSet( const QString &pix )
47{ 47{
48 QImage img = loadImage( pix );
49 QPixmap pm;
50 pm.convertFromImage( img );
51 QIconSet is( pm );
52 QIconSet::Size size = pm.width() <= 22 ? QIconSet::Small : QIconSet::Large;
53
54 QPixmap dpm = loadPixmap( pix + "_disabled" ); 48 QPixmap dpm = loadPixmap( pix + "_disabled" );
55 49 QPixmap pm = loadPixmap( pix );
56 #ifndef QT_NO_DEPTH_32// have alpha-blended pixmaps 50 QIconSet is( pm );
57 if ( dpm.isNull() ) {
58 QImage dimg( img.width(), img.height(), 32 );
59 for ( int y = 0; y < img.height(); y++ ) {
60 for ( int x = 0; x < img.width(); x++ ) {
61 QRgb p = img.pixel( x, y );
62 uint a = (p & 0xff000000) / 3;
63 p = (p & 0x00ffffff) | (a & 0xff000000);
64 dimg.setPixel( x, y, p );
65 }
66 }
67
68 dimg.setAlphaBuffer( TRUE );
69 dpm.convertFromImage( dimg );
70 }
71#endif
72
73 if ( !dpm.isNull() ) 51 if ( !dpm.isNull() )
74 is.setPixmap( dpm, size, QIconSet::Disabled ); 52 is.setPixmap( dpm, pm.width() <= 22 ? QIconSet::Small : QIconSet::Large, QIconSet::Disabled );
75
76 return is; 53 return is;