author | llornkcor <llornkcor> | 2004-01-10 22:56:33 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-01-10 22:56:33 (UTC) |
commit | 3e59fa6940ec44c91b43843665aeb75f81af6ed2 (patch) (unidiff) | |
tree | 31a19bc805128541827a27181c0a1e313b232faa | |
parent | 989165b0bb9119af8ec9491fc5b6c997f014bd87 (diff) | |
download | opie-3e59fa6940ec44c91b43843665aeb75f81af6ed2.zip opie-3e59fa6940ec44c91b43843665aeb75f81af6ed2.tar.gz opie-3e59fa6940ec44c91b43843665aeb75f81af6ed2.tar.bz2 |
dont show background face for large screens, as it doesnt fit
-rw-r--r-- | noncore/tools/clock/clock.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index ecbf12f..4d92683 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -498,49 +498,51 @@ void Clock::appMessage( const QCString& msg, const QByteArray& /*data*/ ) | |||
498 | raise(); | 498 | raise(); |
499 | QPEApplication::setKeepRunning(); | 499 | QPEApplication::setKeepRunning(); |
500 | setActiveWindow(); | 500 | setActiveWindow(); |
501 | } | 501 | } |
502 | 502 | ||
503 | void Clock::timerEvent( QTimerEvent *e ) | 503 | void Clock::timerEvent( QTimerEvent *e ) |
504 | { | 504 | { |
505 | static int stop = 0; | 505 | static int stop = 0; |
506 | if ( stop < 120 && bSound ) | 506 | if ( stop < 120 && bSound ) |
507 | { | 507 | { |
508 | Sound::soundAlarm(); | 508 | Sound::soundAlarm(); |
509 | stop++; | 509 | stop++; |
510 | } | 510 | } |
511 | else | 511 | else |
512 | { | 512 | { |
513 | stop = 0; | 513 | stop = 0; |
514 | killTimer( e->timerId() ); | 514 | killTimer( e->timerId() ); |
515 | clearTimer(); | 515 | clearTimer(); |
516 | setCaption( tr( "Clock: Alarm was missed." ) ); | 516 | setCaption( tr( "Clock: Alarm was missed." ) ); |
517 | } | 517 | } |
518 | } | 518 | } |
519 | 519 | ||
520 | AnalogClock::AnalogClock(QWidget * parent, const char * name) : QFrame( parent, name ), clear(true) | 520 | AnalogClock::AnalogClock(QWidget * parent, const char * name) : QFrame( parent, name ), clear(true) |
521 | { | 521 | { |
522 | bg = Resource::loadPixmap("clock/bg"); | 522 | QWidget *d = QApplication::desktop(); |
523 | if(d->width() <= 240) | ||
524 | bg = Resource::loadPixmap("clock/bg"); | ||
523 | } | 525 | } |
524 | 526 | ||
525 | QSizePolicy AnalogClock::sizePolicy() const | 527 | QSizePolicy AnalogClock::sizePolicy() const |
526 | { | 528 | { |
527 | return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); | 529 | return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); |
528 | } | 530 | } |
529 | 531 | ||
530 | void AnalogClock::drawContents( QPainter *p ) | 532 | void AnalogClock::drawContents( QPainter *p ) |
531 | { | 533 | { |
532 | QRect r = contentsRect(); | 534 | QRect r = contentsRect(); |
533 | QRect fr; | 535 | QRect fr; |
534 | 536 | ||
535 | p->drawPixmap(QPoint(0, 0), bg, r); | 537 | p->drawPixmap(QPoint(0, 0), bg, r); |
536 | 538 | ||
537 | if ( r. width ( ) > r. height ( )) | 539 | if ( r. width ( ) > r. height ( )) |
538 | fr. setRect (( r. width ( ) - r. height ( )) / 2, r. y ( ), r. height ( ), r. height ( )); | 540 | fr. setRect (( r. width ( ) - r. height ( )) / 2, r. y ( ), r. height ( ), r. height ( )); |
539 | else | 541 | else |
540 | fr. setRect ( r. x ( ), ( r. height ( ) - r. width ( )) / 2, r. width ( ), r. width ( )); | 542 | fr. setRect ( r. x ( ), ( r. height ( ) - r. width ( )) / 2, r. width ( ), r. width ( )); |
541 | 543 | ||
542 | QPoint center = fr. center ( ); // ( fr.x() + fr.width() / 2, fr.y() + fr.height() / 2 ); | 544 | QPoint center = fr. center ( ); // ( fr.x() + fr.width() / 2, fr.y() + fr.height() / 2 ); |
543 | QPoint l1 ( center. x ( ), fr. y ( ) + 2 ); | 545 | QPoint l1 ( center. x ( ), fr. y ( ) + 2 ); |
544 | QPoint l2 ( center. x ( ), fr. y ( ) + 8 ); | 546 | QPoint l2 ( center. x ( ), fr. y ( ) + 8 ); |
545 | 547 | ||
546 | 548 | ||