summaryrefslogtreecommitdiff
path: root/noncore/tools/clock/clock.cpp
Unidiff
Diffstat (limited to 'noncore/tools/clock/clock.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp6
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
@@ -513,23 +513,29 @@ void Clock::timerEvent( QTimerEvent *e )
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
519AnalogClock::AnalogClock(QWidget * parent, const char * name) : QFrame( parent, name ), clear(true)
520{
521 bg = Resource::loadPixmap("clock/bg");
522}
519 523
520QSizePolicy AnalogClock::sizePolicy() const 524QSizePolicy AnalogClock::sizePolicy() const
521{ 525{
522 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); 526 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
523} 527}
524 528
525void AnalogClock::drawContents( QPainter *p ) 529void 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 );