author | zautrix <zautrix> | 2005-02-04 17:45:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-04 17:45:57 (UTC) |
commit | f4c3a3e3da57e957b920fe4662c6decd6764f0ee (patch) (unidiff) | |
tree | 05648d7d7ac6a0e4798cad08b2993df1375d84d5 /korganizer/komonthview.cpp | |
parent | b7c502a598566264e6e7129524104b6e39438f03 (diff) | |
download | kdepimpi-f4c3a3e3da57e957b920fe4662c6decd6764f0ee.zip kdepimpi-f4c3a3e3da57e957b920fe4662c6decd6764f0ee.tar.gz kdepimpi-f4c3a3e3da57e957b920fe4662c6decd6764f0ee.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/komonthview.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index daa37fd..dfa89e2 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -605,26 +605,35 @@ void MonthViewCell::updateCell() | |||
605 | } | 605 | } |
606 | // insert due todos | 606 | // insert due todos |
607 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); | 607 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); |
608 | Todo *todo; | 608 | Todo *todo; |
609 | for(todo = todos.first(); todo; todo = todos.next()) { | 609 | for(todo = todos.first(); todo; todo = todos.next()) { |
610 | insertTodo( todo ); | 610 | insertTodo( todo ); |
611 | } | 611 | } |
612 | finishUpdateCell(); | 612 | finishUpdateCell(); |
613 | // if ( isVisible()) | 613 | // if ( isVisible()) |
614 | //qApp->processEvents(); | 614 | //qApp->processEvents(); |
615 | } | 615 | } |
616 | 616 | ||
617 | void MonthViewCell::updateConfig() | 617 | void MonthViewCell::updateConfig( bool bigFont ) // = false |
618 | { | 618 | { |
619 | |||
620 | if ( bigFont ) { | ||
621 | QFont fo = KOPrefs::instance()->mMonthViewFont; | ||
622 | int ps = fo.pointSize() + 2; | ||
623 | if ( ps < 18 ) | ||
624 | ps += 2; | ||
625 | fo.setPointSize( ps ); | ||
626 | setFont( fo ); | ||
627 | } else | ||
619 | setFont( KOPrefs::instance()->mMonthViewFont ); | 628 | setFont( KOPrefs::instance()->mMonthViewFont ); |
620 | 629 | ||
621 | QFontMetrics fm( font() ); | 630 | QFontMetrics fm( font() ); |
622 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); | 631 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); |
623 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); | 632 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); |
624 | mHolidayPalette = mStandardPalette; | 633 | mHolidayPalette = mStandardPalette; |
625 | mPrimaryPalette = mStandardPalette; | 634 | mPrimaryPalette = mStandardPalette; |
626 | mNonPrimaryPalette = mStandardPalette; | 635 | mNonPrimaryPalette = mStandardPalette; |
627 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { | 636 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { |
628 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); | 637 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); |
629 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); | 638 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); |
630 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); | 639 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); |
@@ -860,24 +869,25 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
860 | } | 869 | } |
861 | mCellsW.resize( mDaysPerWeek ); | 870 | mCellsW.resize( mDaysPerWeek ); |
862 | for( col = 0; col < mDaysPerWeek; ++col ) { | 871 | for( col = 0; col < mDaysPerWeek; ++col ) { |
863 | MonthViewCell *cell = new MonthViewCell( this, mWeekView ); | 872 | MonthViewCell *cell = new MonthViewCell( this, mWeekView ); |
864 | mCellsW.insert( col, cell ); | 873 | mCellsW.insert( col, cell ); |
865 | 874 | ||
866 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), | 875 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), |
867 | SLOT( defaultAction( Incidence * ) ) ); | 876 | SLOT( defaultAction( Incidence * ) ) ); |
868 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), | 877 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), |
869 | SIGNAL( newEventSignal( QDateTime ) ) ); | 878 | SIGNAL( newEventSignal( QDateTime ) ) ); |
870 | connect( cell, SIGNAL( showDaySignal( QDate ) ), | 879 | connect( cell, SIGNAL( showDaySignal( QDate ) ), |
871 | SIGNAL( showDaySignal( QDate ) ) ); | 880 | SIGNAL( showDaySignal( QDate ) ) ); |
881 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); | ||
872 | } | 882 | } |
873 | 883 | ||
874 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); | 884 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); |
875 | mContextMenu = eventPopup(); | 885 | mContextMenu = eventPopup(); |
876 | // updateConfig(); //useless here | 886 | // updateConfig(); //useless here |
877 | 887 | ||
878 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); | 888 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); |
879 | #if 0 | 889 | #if 0 |
880 | mWidStack = new QWidgetStack( this ); | 890 | mWidStack = new QWidgetStack( this ); |
881 | mMonthView = new QWidget( mWidStack ); | 891 | mMonthView = new QWidget( mWidStack ); |
882 | mWeekView = new QWidget( mWidStack ); | 892 | mWeekView = new QWidget( mWidStack ); |
883 | #endif | 893 | #endif |
@@ -983,24 +993,28 @@ void KOMonthView::updateConfig() | |||
983 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 993 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
984 | if ( ! mShowWeekView ) { | 994 | if ( ! mShowWeekView ) { |
985 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) | 995 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) |
986 | computeLayout(); | 996 | computeLayout(); |
987 | } | 997 | } |
988 | updateDayLabels(); | 998 | updateDayLabels(); |
989 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); | 999 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); |
990 | //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; | 1000 | //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; |
991 | //resizeEvent( 0 ); | 1001 | //resizeEvent( 0 ); |
992 | for (uint i = 0; i < mCells.count(); ++i) { | 1002 | for (uint i = 0; i < mCells.count(); ++i) { |
993 | mCells[i]->updateConfig(); | 1003 | mCells[i]->updateConfig(); |
994 | } | 1004 | } |
1005 | |||
1006 | for (uint i = 0; i < mCellsW.count(); ++i) { | ||
1007 | mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); | ||
1008 | } | ||
995 | #ifdef DESKTOP_VERSION | 1009 | #ifdef DESKTOP_VERSION |
996 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); | 1010 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); |
997 | #endif | 1011 | #endif |
998 | updateView(); | 1012 | updateView(); |
999 | } | 1013 | } |
1000 | 1014 | ||
1001 | void KOMonthView::updateDayLabels() | 1015 | void KOMonthView::updateDayLabels() |
1002 | { | 1016 | { |
1003 | 1017 | ||
1004 | QPtrVector<QLabel> *mDayLabelsT; | 1018 | QPtrVector<QLabel> *mDayLabelsT; |
1005 | #if 0 | 1019 | #if 0 |
1006 | if (mShowWeekView ) | 1020 | if (mShowWeekView ) |