summaryrefslogtreecommitdiff
authordrw <drw>2002-05-18 22:25:24 (UTC)
committer drw <drw>2002-05-18 22:25:24 (UTC)
commitaa2cff2e8838829125c0ff4efe969b3835c79fa7 (patch) (unidiff)
treeb47056d32711ee7bc3f24dcf86a6832df78f2815
parentbe9add24a65c8ad89bc5425aa4d42c4b598a50be (diff)
downloadopie-aa2cff2e8838829125c0ff4efe969b3835c79fa7.zip
opie-aa2cff2e8838829125c0ff4efe969b3835c79fa7.tar.gz
opie-aa2cff2e8838829125c0ff4efe969b3835c79fa7.tar.bz2
Added ability to turn off background image.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 1598d13..30afe64 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -143,49 +143,49 @@ public:
143 //int backgroundMode = 2; 143 //int backgroundMode = 2;
144 144
145 if ( backgroundMode == 1 ) { 145 if ( backgroundMode == 1 ) {
146 146
147 // Double buffer the background 147 // Double buffer the background
148 static QPixmap *bg = NULL; 148 static QPixmap *bg = NULL;
149 static QColor bgColor; 149 static QColor bgColor;
150 150
151 if ( (bg == NULL) || (bgColor != colorGroup().button()) ) { 151 if ( (bg == NULL) || (bgColor != colorGroup().button()) ) {
152 // Create a new background double buffer 152 // Create a new background double buffer
153 if (bg == NULL) 153 if (bg == NULL)
154 bg = new QPixmap( width(), height() ); 154 bg = new QPixmap( width(), height() );
155 bgColor = colorGroup().button(); 155 bgColor = colorGroup().button();
156 QPainter painter( bg ); 156 QPainter painter( bg );
157 157
158// painter.fillRect( QRect( 0, 0, width(), height() ), colorGroup().background().light(110)); 158// painter.fillRect( QRect( 0, 0, width(), height() ), colorGroup().background().light(110));
159 painter.fillRect( QRect( 0, 0, width(), height() ), background); 159 painter.fillRect( QRect( 0, 0, width(), height() ), background);
160 // Overlay the Qtopia logo in the center 160 // Overlay the Qtopia logo in the center
161 QImage logo; 161 QImage logo;
162 if (QFile::exists(backgroundImage)) { 162 if (QFile::exists(backgroundImage)) {
163 logo = QImage(backgroundImage); 163 logo = QImage(backgroundImage);
164 } else { 164 } else {
165 logo = Resource::loadImage(backgroundImage ); 165 logo = Resource::loadImage(backgroundImage );
166 } 166 }
167 if ( !logo.isNull() ) 167 if ( !logo.isNull() && config.readBoolEntry( "UseBackgroundImage", TRUE ) )
168 painter.drawImage( (width() - logo.width()) / 2, 168 painter.drawImage( (width() - logo.width()) / 2,
169 (height() - logo.height()) / 2, logo ); 169 (height() - logo.height()) / 2, logo );
170 } 170 }
171 171
172 // Draw the double buffer to the widget (it is tiled for when the icon view is large) 172 // Draw the double buffer to the widget (it is tiled for when the icon view is large)
173 p->drawTiledPixmap( r, *bg, QPoint( (r.x() + contentsX()) % bg->width(), 173 p->drawTiledPixmap( r, *bg, QPoint( (r.x() + contentsX()) % bg->width(),
174 (r.y() + contentsY()) % bg->height() ) ); 174 (r.y() + contentsY()) % bg->height() ) );
175 } else if ( backgroundMode == 2 ) { 175 } else if ( backgroundMode == 2 ) {
176 static QPixmap *bg = 0; 176 static QPixmap *bg = 0;
177 static QColor bgColor; 177 static QColor bgColor;
178 if ( !bg || (bgColor != colorGroup().background()) ) { 178 if ( !bg || (bgColor != colorGroup().background()) ) {
179 bgColor = colorGroup().background(); 179 bgColor = colorGroup().background();
180 bg = new QPixmap( width(), 9 ); 180 bg = new QPixmap( width(), 9 );
181 QPainter painter( bg ); 181 QPainter painter( bg );
182 for ( int i = 0; i < 3; i++ ) { 182 for ( int i = 0; i < 3; i++ ) {
183 painter.setPen( colorGroup().background().light(130) ); 183 painter.setPen( colorGroup().background().light(130) );
184 painter.drawLine( 0, i*3, width()-1, i*3 ); 184 painter.drawLine( 0, i*3, width()-1, i*3 );
185 painter.drawLine( 0, i*3+1, width()-1, i*3+1 ); 185 painter.drawLine( 0, i*3+1, width()-1, i*3+1 );
186 painter.setPen( colorGroup().background().light(105) ); 186 painter.setPen( colorGroup().background().light(105) );
187 painter.drawLine( 0, i*3+2, width()-1, i*3+2 ); 187 painter.drawLine( 0, i*3+2, width()-1, i*3+2 );
188 } 188 }
189 } 189 }
190 p->drawTiledPixmap( r, *bg, QPoint( (r.x() + contentsX()) % bg->width(), 190 p->drawTiledPixmap( r, *bg, QPoint( (r.x() + contentsX()) % bg->width(),
191 (r.y() + contentsY()) % bg->height() ) ); 191 (r.y() + contentsY()) % bg->height() ) );