author | mickeyl <mickeyl> | 2004-09-12 13:56:12 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-09-12 13:56:12 (UTC) |
commit | 16f05a60665f1ba6aa61ac1032f3153578e5aaaf (patch) (unidiff) | |
tree | de8d6c077b660485162f8989657ca49a9e4ca4ed /core/apps/calibrate/calibrate.cpp | |
parent | 0c7a238e2116daa67c84e389d53fc64f8c2d78b3 (diff) | |
download | opie-16f05a60665f1ba6aa61ac1032f3153578e5aaaf.zip opie-16f05a60665f1ba6aa61ac1032f3153578e5aaaf.tar.gz opie-16f05a60665f1ba6aa61ac1032f3153578e5aaaf.tar.bz2 |
show backdrop, make crosshair a bit more prominent, enable calibration test when QT_DEBUG is set
Diffstat (limited to 'core/apps/calibrate/calibrate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/calibrate/calibrate.cpp | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/core/apps/calibrate/calibrate.cpp b/core/apps/calibrate/calibrate.cpp index e079195..5f52bdc 100644 --- a/core/apps/calibrate/calibrate.cpp +++ b/core/apps/calibrate/calibrate.cpp | |||
@@ -28,4 +28,4 @@ | |||
28 | 28 | ||
29 | //#if defined(Q_WS_QWS) || defined(_WS_QWS_) | 29 | #include <qpixmap.h> |
30 | 30 | #include <qimage.h> | |
31 | #include <qpainter.h> | 31 | #include <qpainter.h> |
@@ -44,9 +44,7 @@ Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) : | |||
44 | setGeometry( 0, 0, desk.width(), desk.height() ); | 44 | setGeometry( 0, 0, desk.width(), desk.height() ); |
45 | if ( desk.height() < 250 ) { | 45 | crosshair.convertFromImage( Resource::loadImage("launcher/crosshair") ); |
46 | int w = desk.height() / 3; | 46 | |
47 | logo.convertFromImage( Resource::loadImage( "logo/opielogo" ).smoothScale( w, w ) ); | 47 | splash.convertFromImage( Resource::loadImage("launcher/firstuse").smoothScale( width(), height() ) ); |
48 | } | 48 | setBackgroundPixmap( splash ); |
49 | else { | 49 | |
50 | logo = Resource::loadPixmap( "logo/opielogo" ); | ||
51 | } | ||
52 | cd.screenPoints[ QWSPointerCalibrationData::TopLeft ] = QPoint( offset, offset ); | 50 | cd.screenPoints[ QWSPointerCalibrationData::TopLeft ] = QPoint( offset, offset ); |
@@ -88,3 +86,3 @@ void Calibrate::hide() | |||
88 | { | 86 | { |
89 | if ( isVisible ( )) { | 87 | if ( isVisible()) { |
90 | store(); | 88 | store(); |
@@ -128,3 +126,3 @@ bool Calibrate::sanityCheck() | |||
128 | // not needed anywhere .. just calculate it, so it's there | 126 | // not needed anywhere .. just calculate it, so it's there |
129 | cd. devPoints [QWSPointerCalibrationData::Center] = QRect ( tl, br ). normalize ( ). center ( ); | 127 | cd.devPoints[QWSPointerCalibrationData::Center] = QRect( tl, br ).normalize().center(); |
130 | 128 | ||
@@ -170,6 +168,6 @@ void Calibrate::moveCrosshair( QPoint pt ) | |||
170 | showCross = FALSE; | 168 | showCross = FALSE; |
171 | repaint( crossPos.x() - 8, crossPos.y() - 8, 16, 16 ); | 169 | repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 ); |
172 | showCross = TRUE; | 170 | showCross = TRUE; |
173 | crossPos = pt; | 171 | crossPos = pt; |
174 | repaint( crossPos.x() - 8, crossPos.y() - 8, 16, 16 ); | 172 | repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 ); |
175 | } | 173 | } |
@@ -179,11 +177,3 @@ void Calibrate::paintEvent( QPaintEvent * ) | |||
179 | QPainter p( this ); | 177 | QPainter p( this ); |
180 | 178 | int y = height() / 3; | |
181 | int y; | ||
182 | |||
183 | if ( !logo.isNull() ) { | ||
184 | y = height() / 2 - logo.height() - 15; | ||
185 | p.drawPixmap( ( width() - logo.width() ) / 2, y, logo ); | ||
186 | } | ||
187 | |||
188 | y = height() / 2 + 15; | ||
189 | 179 | ||
@@ -193,14 +183,20 @@ void Calibrate::paintEvent( QPaintEvent * ) | |||
193 | 183 | ||
194 | QFont f = p.font(); | 184 | if ( !showCross ) return; |
195 | f.setBold( TRUE ); | 185 | |
196 | p.setFont( f ); | 186 | #if 0 |
197 | p.drawText( 0, y, width(), height() - y, AlignHCenter | WordBreak, | 187 | if ( crosshair.isNull() ) { |
198 | tr( "Welcome to Opie" ) ); | 188 | #endif |
199 | 189 | p.setPen( QColor( 0, 0, 155 ) ); | |
200 | if ( showCross ) { | 190 | p.drawEllipse( crossPos.x()-8, crossPos.y()-8, 16, 16 ); |
201 | p.drawRect( crossPos.x() - 1, crossPos.y() - 8, 2, 7 ); | 191 | p.setPen( QColor( 250, 220, 220 ) ); |
202 | p.drawRect( crossPos.x() - 1, crossPos.y() + 1, 2, 7 ); | 192 | p.drawRoundRect( crossPos.x()-12, crossPos.y()-12, 24, 24, 75, 75 ); |
203 | p.drawRect( crossPos.x() - 8, crossPos.y() - 1, 7, 2 ); | 193 | p.setPen( QColor( 0, 0, 120 ) ); |
204 | p.drawRect( crossPos.x() + 1, crossPos.y() - 1, 7, 2 ); | 194 | p.drawRect( crossPos.x() - 1, crossPos.y() - 14, 2, 13 ); |
195 | p.drawRect( crossPos.x() - 1, crossPos.y() + 1, 2, 13 ); | ||
196 | p.drawRect( crossPos.x() - 14, crossPos.y() - 1, 13, 2 ); | ||
197 | p.drawRect( crossPos.x() + 1, crossPos.y() - 1, 13, 2 ); | ||
198 | #if 0 | ||
205 | } | 199 | } |
200 | else p.drawPixmap( crossPos.x(), crossPos.y(), crosshair ); | ||
201 | #endif | ||
206 | } | 202 | } |