Diffstat (limited to 'noncore/tools/clock/clock.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/clock/clock.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index 74b7147..41c99a8 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -507,35 +507,41 @@ void Clock::timerEvent( QTimerEvent *e ) | |||
507 | Sound::soundAlarm(); | 507 | Sound::soundAlarm(); |
508 | stop++; | 508 | stop++; |
509 | } | 509 | } |
510 | else | 510 | else |
511 | { | 511 | { |
512 | stop = 0; | 512 | stop = 0; |
513 | killTimer( e->timerId() ); | 513 | killTimer( e->timerId() ); |
514 | clearTimer(); | 514 | clearTimer(); |
515 | setCaption( tr( "Clock: Alarm was missed." ) ); | 515 | setCaption( tr( "Clock: Alarm was missed." ) ); |
516 | } | 516 | } |
517 | } | 517 | } |
518 | 518 | ||
519 | AnalogClock::AnalogClock(QWidget * parent, const char * name) : QFrame( parent, name ), clear(true) | ||
520 | { | ||
521 | bg = Resource::loadPixmap("clock/bg"); | ||
522 | } | ||
519 | 523 | ||
520 | QSizePolicy AnalogClock::sizePolicy() const | 524 | QSizePolicy AnalogClock::sizePolicy() const |
521 | { | 525 | { |
522 | return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); | 526 | return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); |
523 | } | 527 | } |
524 | 528 | ||
525 | void AnalogClock::drawContents( QPainter *p ) | 529 | void AnalogClock::drawContents( QPainter *p ) |
526 | { | 530 | { |
527 | QRect r = contentsRect(); | 531 | QRect r = contentsRect(); |
528 | QRect fr; | 532 | QRect fr; |
529 | 533 | ||
534 | p->drawPixmap(QPoint(0, 0), bg, r); | ||
535 | |||
530 | if ( r. width ( ) > r. height ( )) | 536 | if ( r. width ( ) > r. height ( )) |
531 | fr. setRect (( r. width ( ) - r. height ( )) / 2, r. y ( ), r. height ( ), r. height ( )); | 537 | fr. setRect (( r. width ( ) - r. height ( )) / 2, r. y ( ), r. height ( ), r. height ( )); |
532 | else | 538 | else |
533 | fr. setRect ( r. x ( ), ( r. height ( ) - r. width ( )) / 2, r. width ( ), r. width ( )); | 539 | fr. setRect ( r. x ( ), ( r. height ( ) - r. width ( )) / 2, r. width ( ), r. width ( )); |
534 | 540 | ||
535 | QPoint center = fr. center ( ); // ( fr.x() + fr.width() / 2, fr.y() + fr.height() / 2 ); | 541 | QPoint center = fr. center ( ); // ( fr.x() + fr.width() / 2, fr.y() + fr.height() / 2 ); |
536 | QPoint l1 ( center. x ( ), fr. y ( ) + 2 ); | 542 | QPoint l1 ( center. x ( ), fr. y ( ) + 2 ); |
537 | QPoint l2 ( center. x ( ), fr. y ( ) + 8 ); | 543 | QPoint l2 ( center. x ( ), fr. y ( ) + 8 ); |
538 | 544 | ||
539 | 545 | ||
540 | 546 | ||
541 | if ( clear ) | 547 | if ( clear ) |