author | zautrix <zautrix> | 2005-04-01 20:32:33 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-01 20:32:33 (UTC) |
commit | 12fc62df25e15f6b20d8026ceb09118ca3ed7205 (patch) (unidiff) | |
tree | 8686600dc4ed5e5f6e9c79e007b818bfb4546750 | |
parent | b1e3bf53b1c4cc46ef0a2ded04338bc38a640161 (diff) | |
download | kdepimpi-12fc62df25e15f6b20d8026ceb09118ca3ed7205.zip kdepimpi-12fc62df25e15f6b20d8026ceb09118ca3ed7205.tar.gz kdepimpi-12fc62df25e15f6b20d8026ceb09118ca3ed7205.tar.bz2 |
filterfix
-rw-r--r-- | bin/kdepim/korganizer/icons16/filter.png | bin | 0 -> 820 bytes | |||
-rw-r--r-- | korganizer/koagendaview.cpp | 2 |
2 files changed, 1 insertions, 1 deletions
diff --git a/bin/kdepim/korganizer/icons16/filter.png b/bin/kdepim/korganizer/icons16/filter.png new file mode 100644 index 0000000..83890a8 --- a/dev/null +++ b/bin/kdepim/korganizer/icons16/filter.png | |||
Binary files differ | |||
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 667ff2a..1627dba 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -621,97 +621,97 @@ void KOAgendaView::resizeEvent( QResizeEvent* e ) | |||
621 | //qDebug("mAgenda->resize+++++++++++++++ "); | 621 | //qDebug("mAgenda->resize+++++++++++++++ "); |
622 | updateConfig(); | 622 | updateConfig(); |
623 | //qDebug("KOAgendaView::Updating now possible "); | 623 | //qDebug("KOAgendaView::Updating now possible "); |
624 | } else | 624 | } else |
625 | createDayLabels(); | 625 | createDayLabels(); |
626 | //qDebug("resizeEvent end "); | 626 | //qDebug("resizeEvent end "); |
627 | 627 | ||
628 | } | 628 | } |
629 | void KOAgendaView::slotDaylabelClicked( int num ) | 629 | void KOAgendaView::slotDaylabelClicked( int num ) |
630 | { | 630 | { |
631 | 631 | ||
632 | QDate firstDate = mSelectedDates.first(); | 632 | QDate firstDate = mSelectedDates.first(); |
633 | if ( num == -1 ) | 633 | if ( num == -1 ) |
634 | emit showDateView( 6, firstDate ); | 634 | emit showDateView( 6, firstDate ); |
635 | else if (num >= 0 ) { | 635 | else if (num >= 0 ) { |
636 | if ( mSelectedDates.count() == 1) | 636 | if ( mSelectedDates.count() == 1) |
637 | emit showDateView( 9, firstDate.addDays( num ) ); | 637 | emit showDateView( 9, firstDate.addDays( num ) ); |
638 | else | 638 | else |
639 | emit showDateView( 3, firstDate.addDays( num ) ); | 639 | emit showDateView( 3, firstDate.addDays( num ) ); |
640 | } | 640 | } |
641 | else | 641 | else |
642 | showDateView( 10, firstDate.addDays(1) ); | 642 | showDateView( 10, firstDate.addDays(1) ); |
643 | } | 643 | } |
644 | 644 | ||
645 | KOAgendaButton* KOAgendaView::getNewDaylabel() | 645 | KOAgendaButton* KOAgendaView::getNewDaylabel() |
646 | { | 646 | { |
647 | 647 | ||
648 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); | 648 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); |
649 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); | 649 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); |
650 | mDayLabelsList.append( dayLabel ); | 650 | mDayLabelsList.append( dayLabel ); |
651 | mLayoutDayLabels->addWidget(dayLabel); | 651 | mLayoutDayLabels->addWidget(dayLabel); |
652 | return dayLabel ; | 652 | return dayLabel ; |
653 | } | 653 | } |
654 | 654 | ||
655 | void KOAgendaView::createDayLabels() | 655 | void KOAgendaView::createDayLabels() |
656 | { | 656 | { |
657 | 657 | ||
658 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { | 658 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { |
659 | // qDebug(" KOAgendaView::createDayLabels() blocked "); | 659 | // qDebug(" KOAgendaView::createDayLabels() blocked "); |
660 | return; | 660 | return; |
661 | 661 | ||
662 | } | 662 | } |
663 | int newHight; | 663 | int newHight; |
664 | 664 | ||
665 | // ### Before deleting and recreating we could check if mSelectedDates changed... | 665 | // ### Before deleting and recreating we could check if mSelectedDates changed... |
666 | // It would remove some flickering and gain speed (since this is called by | 666 | // It would remove some flickering and gain speed (since this is called by |
667 | // each updateView() call) | 667 | // each updateView() call) |
668 | 668 | ||
669 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; | 669 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; |
670 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); | 670 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); |
671 | if ( maxWid < 0 ) | 671 | if ( maxWid < 0 ) |
672 | maxWid = 20; | 672 | maxWid = 20; |
673 | 673 | ||
674 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 674 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
675 | QFontMetrics fm ( dlf ); | 675 | QFontMetrics fm ( dlf ); |
676 | int selCount = mSelectedDates.count(); | 676 | int selCount = mSelectedDates.count(); |
677 | QString dayTest = "Mon 20"; | 677 | QString dayTest = "Mon 20"; |
678 | //QString dayTest = "Mon 20"; | 678 | //QString dayTest = "Mon 20"; |
679 | int wid = fm.width( dayTest ); | 679 | int wid = fm.width( dayTest ); |
680 | //maxWid -= ( selCount * 3 ); //working for QLabels | 680 | //maxWid -= ( selCount * 3 ); //working for QLabels |
681 | maxWid -= ( selCount * 3 ); //working for QPushButton | 681 | maxWid -= ( selCount * 3 ); //working for QPushButton |
682 | if ( maxWid < 0 ) | 682 | if ( maxWid < 0 ) |
683 | maxWid = 20; | 683 | maxWid = 20; |
684 | int needWid = wid * selCount; | 684 | int needWid = wid * selCount; |
685 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); | 685 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); |
686 | //if ( needWid > maxWid ) | 686 | //if ( needWid > maxWid ) |
687 | // qDebug("DAYLABELS TOOOOOOO BIG "); | 687 | // qDebug("DAYLABELS TOOOOOOO BIG "); |
688 | while ( needWid > maxWid ) { | 688 | while ( needWid > maxWid ) { |
689 | dayTest = dayTest.left( dayTest.length() - 1 ); | 689 | dayTest = dayTest.left( dayTest.length() - 1 ); |
690 | wid = fm.width( dayTest ); | 690 | wid = fm.width( dayTest ); |
691 | needWid = wid * selCount; | 691 | needWid = wid * selCount; |
692 | } | 692 | } |
693 | int maxLen = dayTest.length(); | 693 | int maxLen = dayTest.length(); |
694 | int fontPoint = dlf.pointSize(); | 694 | int fontPoint = dlf.pointSize(); |
695 | if ( maxLen < 2 ) { | 695 | if ( maxLen < 2 ) { |
696 | int fontPoint = dlf.pointSize(); | 696 | int fontPoint = dlf.pointSize(); |
697 | while ( fontPoint > 4 ) { | 697 | while ( fontPoint > 4 ) { |
698 | --fontPoint; | 698 | --fontPoint; |
699 | dlf.setPointSize( fontPoint ); | 699 | dlf.setPointSize( fontPoint ); |
700 | QFontMetrics f( dlf ); | 700 | QFontMetrics f( dlf ); |
701 | wid = f.width( "30" ); | 701 | wid = f.width( "30" ); |
702 | needWid = wid * selCount; | 702 | needWid = wid * selCount; |
703 | if ( needWid < maxWid ) | 703 | if ( needWid < maxWid ) |
704 | break; | 704 | break; |
705 | } | 705 | } |
706 | maxLen = 2; | 706 | maxLen = 2; |
707 | } | 707 | } |
708 | //qDebug("Max len %d ", dayTest.length() ); | 708 | //qDebug("Max len %d ", dayTest.length() ); |
709 | 709 | ||
710 | QFontMetrics tempF( dlf ); | 710 | QFontMetrics tempF( dlf ); |
711 | newHight = tempF.height(); | 711 | newHight = tempF.height(); |
712 | mDayLabels->setFont( dlf ); | 712 | mDayLabels->setFont( dlf ); |
713 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; | 713 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; |
714 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); | 714 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); |
715 | //mLayoutDayLabels->addSpacing( 2 ); | 715 | //mLayoutDayLabels->addSpacing( 2 ); |
716 | // QFont lFont = dlf; | 716 | // QFont lFont = dlf; |
717 | bool appendLabels = false; | 717 | bool appendLabels = false; |