author | umopapisdn <umopapisdn> | 2003-04-12 00:29:05 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2003-04-12 00:29:05 (UTC) |
commit | 79fcbf52d267aa3eb839de35f15992bf5e18f8eb (patch) (unidiff) | |
tree | 5e3e1432654d3c97849356e96a1fc4c538a71118 | |
parent | 59e2de381eebb33238ee1b257736a9ae0afdbb7e (diff) | |
download | opie-79fcbf52d267aa3eb839de35f15992bf5e18f8eb.zip opie-79fcbf52d267aa3eb839de35f15992bf5e18f8eb.tar.gz opie-79fcbf52d267aa3eb839de35f15992bf5e18f8eb.tar.bz2 |
Bugfix: (bug #0000811) Events are now always atleast 12 pixels high in dayview.
-rw-r--r-- | core/pim/datebook/datebookday.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index af98e06..db4c2fd 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp | |||
@@ -592,63 +592,63 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e, | |||
592 | // strCat.insert( where, "<" ); | 592 | // strCat.insert( where, "<" ); |
593 | // where = strCat.find( "<", where ); | 593 | // where = strCat.find( "<", where ); |
594 | // } | 594 | // } |
595 | 595 | ||
596 | QString strNote = ev.notes(); | 596 | QString strNote = ev.notes(); |
597 | where = strNote.find( "<" ); | 597 | where = strNote.find( "<" ); |
598 | while ( where != -1 ) { | 598 | while ( where != -1 ) { |
599 | strNote.remove( where, 1 ); | 599 | strNote.remove( where, 1 ); |
600 | strNote.insert( where, "<" ); | 600 | strNote.insert( where, "<" ); |
601 | where = strNote.find( "<", where ); | 601 | where = strNote.find( "<", where ); |
602 | } | 602 | } |
603 | 603 | ||
604 | text = "<b>" + strDesc + "</b><br>" + "<i>"; | 604 | text = "<b>" + strDesc + "</b><br>" + "<i>"; |
605 | if ( !strCat.isEmpty() ) { | 605 | if ( !strCat.isEmpty() ) { |
606 | text += strCat + "</i><br>"; | 606 | text += strCat + "</i><br>"; |
607 | } | 607 | } |
608 | if (ev.event().type() == Event::Normal ) | 608 | if (ev.event().type() == Event::Normal ) |
609 | setEventText( text ); | 609 | setEventText( text ); |
610 | else | 610 | else |
611 | setAllDayText( text ); | 611 | setAllDayText( text ); |
612 | 612 | ||
613 | text += "<br><br>" + strNote; | 613 | text += "<br><br>" + strNote; |
614 | 614 | ||
615 | setBackgroundMode( PaletteBase ); | 615 | setBackgroundMode( PaletteBase ); |
616 | 616 | ||
617 | QTime start = ev.start(); | 617 | QTime start = ev.start(); |
618 | QTime end = ev.end(); | 618 | QTime end = ev.end(); |
619 | int y = start.hour()*60+start.minute(); | 619 | int y = start.hour()*60+start.minute(); |
620 | int h = end.hour()*60+end.minute()-y; | 620 | int h = end.hour()*60+end.minute()-y; |
621 | int rh = dateBook->dayView()->rowHeight(0); | 621 | int rh = dateBook->dayView()->rowHeight(0); |
622 | y = y*rh/60; | 622 | y = y*rh/60; |
623 | h = h*rh/60; | 623 | h = h*rh/60; |
624 | if ( h < 3 ) { | 624 | |
625 | h = 3; | 625 | if ( h < 12 ) h = 12;// Make sure the widget is no smaller than 12 pixels high, so that it's possible to read atleast the first line. |
626 | } | 626 | if ( y > ((24*rh)-12) ) y=(24*rh)-12;// Make sure the widget fits inside the dayview. |
627 | geom.setY( y ); | 627 | geom.setY( y ); |
628 | geom.setHeight( h ); | 628 | geom.setHeight( h ); |
629 | geom.setX( 0 ); | 629 | geom.setX( 0 ); |
630 | geom.setWidth(dateBook->dayView()->columnWidth(0)-1); | 630 | geom.setWidth(dateBook->dayView()->columnWidth(0)-1); |
631 | 631 | ||
632 | } | 632 | } |
633 | void DateBookDayWidget::setAllDayText( QString &text ) { | 633 | void DateBookDayWidget::setAllDayText( QString &text ) { |
634 | text += "<b>" + tr("This is an all day event.") + "</b><br>"; | 634 | text += "<b>" + tr("This is an all day event.") + "</b>"; |
635 | } | 635 | } |
636 | void DateBookDayWidget::setEventText( QString& text ) { | 636 | void DateBookDayWidget::setEventText( QString& text ) { |
637 | bool whichClock = dateBook->dayView()->whichClock(); | 637 | bool whichClock = dateBook->dayView()->whichClock(); |
638 | if ( ev.startDate() != ev.endDate() ) { | 638 | if ( ev.startDate() != ev.endDate() ) { |
639 | text += "<b>" + tr("Start") + "</b>: "; | 639 | text += "<b>" + tr("Start") + "</b>: "; |
640 | text += TimeString::timeString( ev.event().start().time(), whichClock, FALSE ); | 640 | text += TimeString::timeString( ev.event().start().time(), whichClock, FALSE ); |
641 | text += " - " + TimeString::longDateString( ev.startDate() ) + "<br>"; | 641 | text += " - " + TimeString::longDateString( ev.startDate() ) + "<br>"; |
642 | text += "<b>" + tr("End") + "</b>: "; | 642 | text += "<b>" + tr("End") + "</b>: "; |
643 | text += TimeString::timeString( ev.event().end().time(), whichClock, FALSE ); | 643 | text += TimeString::timeString( ev.event().end().time(), whichClock, FALSE ); |
644 | text += " - " + TimeString::longDateString( ev.endDate() ) + "<br>"; | 644 | text += " - " + TimeString::longDateString( ev.endDate() ); |
645 | } else { | 645 | } else { |
646 | text += "<b>" + tr("Time") + "</b>: "; | 646 | text += "<b>" + tr("Time") + "</b>: "; |
647 | text += TimeString::timeString( ev.start(), whichClock, FALSE ); | 647 | text += TimeString::timeString( ev.start(), whichClock, FALSE ); |
648 | text += "<b>" + tr(" - ") + "</b>"; | 648 | text += "<b>" + tr(" - ") + "</b>"; |
649 | text += TimeString::timeString( ev.end(), whichClock, FALSE ); | 649 | text += TimeString::timeString( ev.end(), whichClock, FALSE ); |
650 | } | 650 | } |
651 | } | 651 | } |
652 | 652 | ||
653 | DateBookDayWidget::~DateBookDayWidget() | 653 | DateBookDayWidget::~DateBookDayWidget() |
654 | { | 654 | { |