summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 93ff55e..c851ab5 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -661,34 +661,35 @@ void KOAgendaView::createDayLabels()
661 661
662 // ### Before deleting and recreating we could check if mSelectedDates changed... 662 // ### Before deleting and recreating we could check if mSelectedDates changed...
663 // It would remove some flickering and gain speed (since this is called by 663 // It would remove some flickering and gain speed (since this is called by
664 // each updateView() call) 664 // each updateView() call)
665 665
666 int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; 666 int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2;
667 mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); 667 mDayLabelsFrame->setMaximumWidth( mUpcomingWidth );
668 if ( maxWid < 20 ) 668 if ( maxWid < 20 )
669 maxWid = 20; 669 maxWid = 20;
670 670
671 QFont dlf = KOPrefs::instance()->mTimeLabelsFont; 671 QFont dlf = KOPrefs::instance()->mTimeLabelsFont;
672 QFontMetrics fm ( dlf ); 672 QFontMetrics fm ( dlf );
673 dlf.setBold( true );
673 int selCount = mSelectedDates.count(); 674 int selCount = mSelectedDates.count();
674 int widModulo = maxWid - (mAgenda->gridSpacingX() * selCount)+1; 675 int widModulo = maxWid - (mAgenda->gridSpacingX() * selCount)+1;
675 QString dayTest = "Mon 20"; 676 QString dayTest = "Mon 20";
676 //QString dayTest = "Mon 20"; 677 //QString dayTest = "Mon 20";
677 int wid = fm.width( dayTest ); 678 int wid = fm.width( dayTest );
678 //maxWid -= ( selCount * 3 ); //working for QLabels 679 //maxWid -= ( selCount * 3 ); //working for QLabels
679 if ( QApplication::desktop()->width() <= 320 ) 680 if ( QApplication::desktop()->width() <= 320 )
680 maxWid -= ( selCount * 3 ); //working for QPushButton 681 maxWid -= ( selCount * 3 ); //working for QPushButton
681 else 682 else
682 maxWid -= ( selCount * 3 ); //working for QPushButton 683 maxWid -= ( selCount * 4 ); //working for QPushButton
683 if ( maxWid < 0 ) 684 if ( maxWid < 0 )
684 maxWid = 20; 685 maxWid = 20;
685 int needWid = wid * selCount; 686 int needWid = wid * selCount;
686 //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); 687 //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid );
687 //if ( needWid > maxWid ) 688 //if ( needWid > maxWid )
688 // qDebug("DAYLABELS TOOOOOOO BIG "); 689 // qDebug("DAYLABELS TOOOOOOO BIG ");
689 while ( needWid > maxWid ) { 690 while ( needWid > maxWid ) {
690 dayTest = dayTest.left( dayTest.length() - 1 ); 691 dayTest = dayTest.left( dayTest.length() - 1 );
691 wid = fm.width( dayTest ); 692 wid = fm.width( dayTest );
692 needWid = wid * selCount; 693 needWid = wid * selCount;
693 } 694 }
694 int maxLen = dayTest.length(); 695 int maxLen = dayTest.length();
@@ -698,25 +699,26 @@ void KOAgendaView::createDayLabels()
698 while ( fontPoint > 4 ) { 699 while ( fontPoint > 4 ) {
699 --fontPoint; 700 --fontPoint;
700 dlf.setPointSize( fontPoint ); 701 dlf.setPointSize( fontPoint );
701 QFontMetrics f( dlf ); 702 QFontMetrics f( dlf );
702 wid = f.width( "30" ); 703 wid = f.width( "30" );
703 needWid = wid * selCount; 704 needWid = wid * selCount;
704 if ( needWid < maxWid ) 705 if ( needWid < maxWid )
705 break; 706 break;
706 } 707 }
707 maxLen = 2; 708 maxLen = 2;
708 } 709 }
709 //qDebug("Max len %d ", dayTest.length() ); 710 //qDebug("Max len %d ", dayTest.length() );
710 711 if ( !KOPrefs::instance()->mTimeLabelsFont.bold() )
712 dlf.setBold( false );
711 QFontMetrics tempF( dlf ); 713 QFontMetrics tempF( dlf );
712 newHight = tempF.height(); 714 newHight = tempF.height();
713 mDayLabels->setFont( dlf ); 715 mDayLabels->setFont( dlf );
714 // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; 716 // mLayoutDayLabels = new QHBoxLayout(mDayLabels);;
715 // mLayoutDayLabels->addSpacing(mTimeLabels->width()); 717 // mLayoutDayLabels->addSpacing(mTimeLabels->width());
716 //mLayoutDayLabels->addSpacing( 2 ); 718 //mLayoutDayLabels->addSpacing( 2 );
717 // QFont lFont = dlf; 719 // QFont lFont = dlf;
718 bool appendLabels = false; 720 bool appendLabels = false;
719 KOAgendaButton *dayLabel; 721 KOAgendaButton *dayLabel;
720 dayLabel = mDayLabelsList.first(); 722 dayLabel = mDayLabelsList.first();
721 if ( !dayLabel ) { 723 if ( !dayLabel ) {
722 appendLabels = true; 724 appendLabels = true;