summaryrefslogtreecommitdiff
authorsandman <sandman>2002-12-22 16:39:25 (UTC)
committer sandman <sandman>2002-12-22 16:39:25 (UTC)
commitf86b3c6613548c9f59019892233f5f90a17d472c (patch) (unidiff)
tree1d5c999b02986b2071cbc70122542dae3cb3037f
parent5fc02331096bdb38de080cd55b83350a95306cca (diff)
downloadopie-f86b3c6613548c9f59019892233f5f90a17d472c.zip
opie-f86b3c6613548c9f59019892233f5f90a17d472c.tar.gz
opie-f86b3c6613548c9f59019892233f5f90a17d472c.tar.bz2
small fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index d69c56f..2f81c3a 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -464,49 +464,49 @@ void AnalogClock::drawContents( QPainter *p )
464 464
465 if ( clear ) { 465 if ( clear ) {
466 erase ( r ); 466 erase ( r );
467 p-> setPen ( NoPen ); 467 p-> setPen ( NoPen );
468 p-> setBrush ( colorGroup ( ). color ( QColorGroup::Base )); 468 p-> setBrush ( colorGroup ( ). color ( QColorGroup::Base ));
469 p-> drawEllipse ( fr ); 469 p-> drawEllipse ( fr );
470 p-> setBrush ( NoBrush ); 470 p-> setBrush ( NoBrush );
471 471
472 // draw ticks 472 // draw ticks
473 p->setPen( QPen( colorGroup ( ). color ( QColorGroup::Text ), 1 ) ); 473 p->setPen( QPen( colorGroup ( ). color ( QColorGroup::Text ), 1 ) );
474 for ( int i = 0; i < 12; i++ ) 474 for ( int i = 0; i < 12; i++ )
475 p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) ); 475 p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) );
476 } 476 }
477 else { 477 else {
478 drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Base ), prevTime, &currTime ); 478 drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Base ), prevTime, &currTime );
479 } 479 }
480 480
481 drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Text ), currTime ); 481 drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Text ), currTime );
482 482
483 prevTime = currTime; 483 prevTime = currTime;
484} 484}
485 485
486void AnalogClock::drawPointers ( QPainter *p, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 ) 486void AnalogClock::drawPointers ( QPainter *p, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 )
487{ 487{
488 QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 488 QPoint center = r. center ( );
489 489
490 QPoint h1( center. x ( ), r. y ( ) + r. height ( ) / 4 ); 490 QPoint h1( center. x ( ), r. y ( ) + r. height ( ) / 4 );
491 QPoint h2( center. x ( ), center. y ( ) ); 491 QPoint h2( center. x ( ), center. y ( ) );
492 492
493 QPoint m1( center. x ( ), r.y() + r.height() / 8 ); 493 QPoint m1( center. x ( ), r.y() + r.height() / 8 );
494 QPoint m2( center. x ( ), center. y ( ) ); 494 QPoint m2( center. x ( ), center. y ( ) );
495 495
496 QPoint s1( center. x ( ), r. y ( ) + 8 ); 496 QPoint s1( center. x ( ), r. y ( ) + 8 );
497 QPoint s2( center. x ( ), center. y ( ) ); 497 QPoint s2( center. x ( ), center. y ( ) );
498 498
499 499
500 if ( !t2 || ( t. minute ( ) != t2-> minute ( ) || t. hour ( ) != t2-> hour ( ))) { 500 if ( !t2 || ( t. minute ( ) != t2-> minute ( ) || t. hour ( ) != t2-> hour ( ))) {
501 // draw hour pointer 501 // draw hour pointer
502 h1 = rotate( center, h1, 30 * ( t.hour() % 12 ) + t.minute() / 2 ); 502 h1 = rotate( center, h1, 30 * ( t.hour() % 12 ) + t.minute() / 2 );
503 h2 = rotate( center, h2, 30 * ( t.hour() % 12 ) + t.minute() / 2 ); 503 h2 = rotate( center, h2, 30 * ( t.hour() % 12 ) + t.minute() / 2 );
504 p-> setPen ( QPen ( c, 3 )); 504 p-> setPen ( QPen ( c, 3 ));
505 p-> drawLine ( h1, h2 ); 505 p-> drawLine ( h1, h2 );
506 } 506 }
507 507
508 if ( !t2 || ( t. minute ( ) != t2-> minute ( ))) { 508 if ( !t2 || ( t. minute ( ) != t2-> minute ( ))) {
509 // draw minute pointer 509 // draw minute pointer
510 m1 = rotate( center, m1, t.minute() * 6 ); 510 m1 = rotate( center, m1, t.minute() * 6 );
511 m2 = rotate( center, m2, t.minute() * 6 ); 511 m2 = rotate( center, m2, t.minute() * 6 );
512 p-> setPen ( QPen ( c, 2 )); 512 p-> setPen ( QPen ( c, 2 ));