-rw-r--r-- | core/pim/datebook/datebookday.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index 8232a51..0b213e9 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp | |||
@@ -485,67 +485,69 @@ void DateBookDay::relayoutPage( bool fromResize ) | |||
485 | } | 485 | } |
486 | if ( overFlow ) | 486 | if ( overFlow ) |
487 | break; | 487 | break; |
488 | } | 488 | } |
489 | for ( int i = 0; i < 24; i++ ) { | 489 | for ( int i = 0; i < 24; i++ ) { |
490 | n = QMAX( n, hours[i] ); | 490 | n = QMAX( n, hours[i] ); |
491 | } | 491 | } |
492 | wid = ( view->columnWidth(0)-1 ) / n; | 492 | wid = ( view->columnWidth(0)-1 ) / n; |
493 | 493 | ||
494 | bool used[24*10]; | 494 | bool used[24*10]; |
495 | memset( used, FALSE, 24*10*sizeof( bool ) ); | 495 | memset( used, FALSE, 24*10*sizeof( bool ) ); |
496 | 496 | ||
497 | for ( int i = 0; i < wCount; i++ ) { | 497 | for ( int i = 0; i < wCount; i++ ) { |
498 | DateBookDayWidget *w = widgetList.at(i); | 498 | DateBookDayWidget *w = widgetList.at(i); |
499 | int xp = place( w, used, n ); | 499 | int xp = place( w, used, n ); |
500 | if ( xp != -1 ) { | 500 | if ( xp != -1 ) { |
501 | QRect geom = w->geometry(); | 501 | QRect geom = w->geometry(); |
502 | geom.setX( xp*(wid+2) ); | 502 | geom.setX( xp*(wid+2) ); |
503 | geom.setWidth( wid ); | 503 | geom.setWidth( wid ); |
504 | w->setGeometry( geom ); | 504 | w->setGeometry( geom ); |
505 | } | 505 | } |
506 | } | 506 | } |
507 | 507 | ||
508 | if (jumpToCurTime && this->date() == QDate::currentDate()) { | 508 | if (jumpToCurTime && this->date() == QDate::currentDate()) { |
509 | view->setContentsPos( 0, QTime::currentTime().hour() * view->rowHeight(0) ); //set listview to current hour | 509 | view->setContentsPos( 0, QTime::currentTime().hour() * view->rowHeight(0) ); //set listview to current hour |
510 | } else { | 510 | } else { |
511 | view->setContentsPos( 0, startTime * view->rowHeight(0) ); | 511 | view->setContentsPos( 0, startTime * view->rowHeight(0) ); |
512 | } | 512 | } |
513 | } | 513 | } |
514 | 514 | ||
515 | timeMarker->setTime( QTime::currentTime() );//display timeMarker | 515 | timeMarker->setTime( QTime::currentTime() );//display timeMarker |
516 | timeMarker->raise(); //on top of all widgets | 516 | timeMarker->raise(); //on top of all widgets |
517 | if (this->date() == QDate::currentDate()) //only show timeMarker on current day | 517 | if (this->date() == QDate::currentDate()) { //only show timeMarker on current day |
518 | timeMarker->show(); else timeMarker->hide(); | 518 | timeMarker->show(); |
519 | 519 | } else { | |
520 | timeMarker->hide(); | ||
521 | } | ||
520 | setUpdatesEnabled( TRUE ); | 522 | setUpdatesEnabled( TRUE ); |
521 | return; | 523 | return; |
522 | } | 524 | } |
523 | 525 | ||
524 | DateBookDayWidget *DateBookDay::intersects( const DateBookDayWidget *item, const QRect &geom ) | 526 | DateBookDayWidget *DateBookDay::intersects( const DateBookDayWidget *item, const QRect &geom ) |
525 | { | 527 | { |
526 | int i = 0; | 528 | int i = 0; |
527 | DateBookDayWidget *w = widgetList.at(i); | 529 | DateBookDayWidget *w = widgetList.at(i); |
528 | int wCount = widgetList.count(); | 530 | int wCount = widgetList.count(); |
529 | while ( i < wCount && w != item ) { | 531 | while ( i < wCount && w != item ) { |
530 | if ( w->geometry().intersects( geom ) ) { | 532 | if ( w->geometry().intersects( geom ) ) { |
531 | return w; | 533 | return w; |
532 | } | 534 | } |
533 | w = widgetList.at(++i); | 535 | w = widgetList.at(++i); |
534 | } | 536 | } |
535 | 537 | ||
536 | return 0; | 538 | return 0; |
537 | } | 539 | } |
538 | 540 | ||
539 | 541 | ||
540 | QDate DateBookDay::date() const | 542 | QDate DateBookDay::date() const |
541 | { | 543 | { |
542 | return currDate; | 544 | return currDate; |
543 | } | 545 | } |
544 | 546 | ||
545 | void DateBookDay::setStartViewTime( int startHere ) | 547 | void DateBookDay::setStartViewTime( int startHere ) |
546 | { | 548 | { |
547 | startTime = startHere; | 549 | startTime = startHere; |
548 | dayView()->clearSelection(); | 550 | dayView()->clearSelection(); |
549 | QTableSelection ts; | 551 | QTableSelection ts; |
550 | 552 | ||
551 | if (jumpToCurTime && this->date() == QDate::currentDate()) {//this should probably be in datebook.cpp where it's called? | 553 | if (jumpToCurTime && this->date() == QDate::currentDate()) {//this should probably be in datebook.cpp where it's called? |