summaryrefslogtreecommitdiff
path: root/library/resource.h
authorzecke <zecke>2002-09-10 12:09:49 (UTC)
committer zecke <zecke>2002-09-10 12:09:49 (UTC)
commit6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (unidiff)
tree6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/resource.h
parentd10cddb3c9ce75bc90b14add14bc133737fe35aa (diff)
downloadopie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2
Qtopia1-6 merge
still to test bic changes to be resolved more changes to be made?
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,7 +1,7 @@
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**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
@@ -45,34 +45,11 @@ public:
45// Inline for compatibility with SHARP ROMs 45// Inline for compatibility with SHARP ROMs
46inline QIconSet Resource::loadIconSet( const QString &pix ) 46inline 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;
77} 54}
78 55