summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f2cfb75..ab96786 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -900,40 +900,43 @@ void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
900 const QDate &td) 900 const QDate &td)
901{ 901{
902#ifndef KORG_NOPRINTER 902#ifndef KORG_NOPRINTER
903 calPrinter->preview(CalPrinter::Month, fd, td); 903 calPrinter->preview(CalPrinter::Month, fd, td);
904#endif 904#endif
905} 905}
906 906
907void KOMonthView::updateConfig() 907void KOMonthView::updateConfig()
908{ 908{
909 909
910 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 910 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
911 911
912 if ( mShowWeekView ) 912 if ( mShowWeekView ) {
913 mWeekStartsMonday = true; 913 mWeekStartsMonday = true;
914 }
914 QFontMetrics fontmetric(mDayLabels[0]->font()); 915 QFontMetrics fontmetric(mDayLabels[0]->font());
915 mWidthLongDayLabel = 0; 916 mWidthLongDayLabel = 0;
916 917
917 for (int i = 0; i < 7; i++) { 918 for (int i = 0; i < 7; i++) {
918 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 919 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
919 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 920 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
920 } 921 }
921 bool temp = mShowSatSunComp ; 922 bool temp = mShowSatSunComp ;
922 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 923 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
923 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) 924 if ( ! mShowWeekView ) {
924 computeLayout(); 925 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
926 computeLayout();
927 }
925 updateDayLabels(); 928 updateDayLabels();
926 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); 929 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
927 int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; 930 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
928 //resizeEvent( 0 ); 931 //resizeEvent( 0 );
929 for (uint i = 0; i < mCells.count(); ++i) { 932 for (uint i = 0; i < mCells.count(); ++i) {
930 mCells[i]->updateConfig(); 933 mCells[i]->updateConfig();
931 } 934 }
932#ifdef DESKTOP_VERSION 935#ifdef DESKTOP_VERSION
933 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); 936 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
934#endif 937#endif
935 updateView(); 938 updateView();
936} 939}
937 940
938void KOMonthView::updateDayLabels() 941void KOMonthView::updateDayLabels()
939{ 942{