-rw-r--r-- | korganizer/komonthview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 4cff23a..6411156 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -883,297 +883,297 @@ void KOMonthView::updateConfig() | |||
883 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; | 883 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; |
884 | } | 884 | } |
885 | bool temp = mShowSatSunComp ; | 885 | bool temp = mShowSatSunComp ; |
886 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 886 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
887 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) | 887 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) |
888 | computeLayout(); | 888 | computeLayout(); |
889 | updateDayLabels(); | 889 | updateDayLabels(); |
890 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); | 890 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); |
891 | int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; | 891 | int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; |
892 | //resizeEvent( 0 ); | 892 | //resizeEvent( 0 ); |
893 | for (uint i = 0; i < mCells.count(); ++i) { | 893 | for (uint i = 0; i < mCells.count(); ++i) { |
894 | mCells[i]->updateConfig(); | 894 | mCells[i]->updateConfig(); |
895 | } | 895 | } |
896 | #ifdef DESKTOP_VERSION | 896 | #ifdef DESKTOP_VERSION |
897 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); | 897 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); |
898 | #endif | 898 | #endif |
899 | updateView(); | 899 | updateView(); |
900 | } | 900 | } |
901 | 901 | ||
902 | void KOMonthView::updateDayLabels() | 902 | void KOMonthView::updateDayLabels() |
903 | { | 903 | { |
904 | 904 | ||
905 | for (int i = 0; i < 7; i++) { | 905 | for (int i = 0; i < 7; i++) { |
906 | if (mWeekStartsMonday) { | 906 | if (mWeekStartsMonday) { |
907 | bool show = mShortDayLabels; | 907 | bool show = mShortDayLabels; |
908 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() ) | 908 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() ) |
909 | show = true; | 909 | show = true; |
910 | mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); | 910 | mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); |
911 | } else { | 911 | } else { |
912 | if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); | 912 | if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); |
913 | else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); | 913 | else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); |
914 | 914 | ||
915 | } | 915 | } |
916 | } | 916 | } |
917 | } | 917 | } |
918 | 918 | ||
919 | void KOMonthView::showDates(const QDate &start, const QDate &) | 919 | void KOMonthView::showDates(const QDate &start, const QDate &) |
920 | { | 920 | { |
921 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; | 921 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; |
922 | 922 | ||
923 | 923 | ||
924 | mStartDate = start; | 924 | mStartDate = start; |
925 | 925 | ||
926 | int startWeekDay = mWeekStartsMonday ? 1 : 7; | 926 | int startWeekDay = mWeekStartsMonday ? 1 : 7; |
927 | 927 | ||
928 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { | 928 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { |
929 | mStartDate = mStartDate.addDays( -1 ); | 929 | mStartDate = mStartDate.addDays( -1 ); |
930 | } | 930 | } |
931 | 931 | ||
932 | bool primary = false; | 932 | bool primary = false; |
933 | uint i; | 933 | uint i; |
934 | for( i = 0; i < mCells.size(); ++i ) { | 934 | for( i = 0; i < mCells.size(); ++i ) { |
935 | QDate date = mStartDate.addDays( i ); | 935 | QDate date = mStartDate.addDays( i ); |
936 | mCells[i]->setDate( date ); | 936 | mCells[i]->setDate( date ); |
937 | 937 | ||
938 | #ifndef KORG_NOPLUGINS | 938 | #ifndef KORG_NOPLUGINS |
939 | // add holiday, if present | 939 | // add holiday, if present |
940 | QString hstring(KOCore::self()->holiday(date)); | 940 | QString hstring(KOCore::self()->holiday(date)); |
941 | mCells[i]->setHoliday( hstring ); | 941 | mCells[i]->setHoliday( hstring ); |
942 | #endif | 942 | #endif |
943 | 943 | ||
944 | } | 944 | } |
945 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); | 945 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); |
946 | for( i = 0; i < 6; ++i ) { | 946 | for( i = 0; i < 6; ++i ) { |
947 | int wno; | 947 | int wno; |
948 | // remember, according to ISO 8601, the first week of the year is the | 948 | // remember, according to ISO 8601, the first week of the year is the |
949 | // first week that contains a thursday. Thus we must subtract off 4, | 949 | // first week that contains a thursday. Thus we must subtract off 4, |
950 | // not just 1. | 950 | // not just 1. |
951 | int dayOfYear = date.dayOfYear(); | 951 | int dayOfYear = date.dayOfYear(); |
952 | if (dayOfYear % 7 != 0) | 952 | if (dayOfYear % 7 != 0) |
953 | wno = dayOfYear / 7 + 1; | 953 | wno = dayOfYear / 7 + 1; |
954 | else | 954 | else |
955 | wno =dayOfYear / 7; | 955 | wno =dayOfYear / 7; |
956 | mWeekLabels[i]->setWeekNum( wno ); | 956 | mWeekLabels[i]->setWeekNum( wno ); |
957 | date = date.addDays( 7 ); | 957 | date = date.addDays( 7 ); |
958 | } | 958 | } |
959 | updateView(); | 959 | updateView(); |
960 | } | 960 | } |
961 | 961 | ||
962 | void KOMonthView::showEvents(QPtrList<Event>) | 962 | void KOMonthView::showEvents(QPtrList<Event>) |
963 | { | 963 | { |
964 | qDebug("KOMonthView::selectEvents is not implemented yet. "); | 964 | qDebug("KOMonthView::selectEvents is not implemented yet. "); |
965 | } | 965 | } |
966 | 966 | ||
967 | void KOMonthView::changeEventDisplay(Event *, int) | 967 | void KOMonthView::changeEventDisplay(Event *, int) |
968 | { | 968 | { |
969 | // this should be re-written to be much more efficient, but this | 969 | // this should be re-written to be much more efficient, but this |
970 | // quick-and-dirty-hack gets the job done for right now. | 970 | // quick-and-dirty-hack gets the job done for right now. |
971 | updateView(); | 971 | updateView(); |
972 | } | 972 | } |
973 | 973 | ||
974 | void KOMonthView::updateView() | 974 | void KOMonthView::updateView() |
975 | { | 975 | { |
976 | 976 | ||
977 | if ( !updatePossible ) | 977 | if ( !updatePossible ) |
978 | return; | 978 | return; |
979 | QTime ti; | 979 | //QTime ti; |
980 | ti.start(); | 980 | //ti.start(); |
981 | #if 1 | 981 | #if 1 |
982 | int i; | 982 | int i; |
983 | for( i = 0; i < mCells.count(); ++i ) { | 983 | for( i = 0; i < mCells.count(); ++i ) { |
984 | mCells[i]->startUpdateCell(); | 984 | mCells[i]->startUpdateCell(); |
985 | } | 985 | } |
986 | 986 | ||
987 | QPtrList<Event> events = calendar()->events(); | 987 | QPtrList<Event> events = calendar()->events(); |
988 | Event *event; | 988 | Event *event; |
989 | QDateTime dt; | 989 | QDateTime dt; |
990 | bool ok; | 990 | bool ok; |
991 | int timeSpan = mCells.size()-1; | 991 | int timeSpan = mCells.size()-1; |
992 | QDate endDate = mStartDate.addDays( timeSpan ); | 992 | QDate endDate = mStartDate.addDays( timeSpan ); |
993 | for( event = events.first(); event; event = events.next() ) { // for event | 993 | for( event = events.first(); event; event = events.next() ) { // for event |
994 | if ( event->doesRecur() ) { | 994 | if ( event->doesRecur() ) { |
995 | bool last; | 995 | bool last; |
996 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); | 996 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); |
997 | QDateTime incidenceEnd; | 997 | QDateTime incidenceEnd; |
998 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 998 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
999 | bool invalid = false; | 999 | bool invalid = false; |
1000 | while( true ) { | 1000 | while( true ) { |
1001 | if ( incidenceStart.isValid() ) { | 1001 | if ( incidenceStart.isValid() ) { |
1002 | incidenceEnd = incidenceStart.addDays( eventlen ); | 1002 | incidenceEnd = incidenceStart.addDays( eventlen ); |
1003 | int st = incidenceStart.date().daysTo( endDate ); | 1003 | int st = incidenceStart.date().daysTo( endDate ); |
1004 | if ( st >= 0 ) { // start before timeend | 1004 | if ( st >= 0 ) { // start before timeend |
1005 | int end = mStartDate.daysTo( incidenceEnd.date() ); | 1005 | int end = mStartDate.daysTo( incidenceEnd.date() ); |
1006 | if ( end >= 0 ) { // end after timestart --- got one! | 1006 | if ( end >= 0 ) { // end after timestart --- got one! |
1007 | //normalize | 1007 | //normalize |
1008 | st = timeSpan - st; | 1008 | st = timeSpan - st; |
1009 | if ( st < 0 ) st = 0; | 1009 | if ( st < 0 ) st = 0; |
1010 | if ( end > timeSpan ) end = timeSpan; | 1010 | if ( end > timeSpan ) end = timeSpan; |
1011 | int iii; | 1011 | int iii; |
1012 | //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); | 1012 | //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); |
1013 | for ( iii = st;iii<= end;++iii) | 1013 | for ( iii = st;iii<= end;++iii) |
1014 | mCells[iii]->insertEvent( event ); | 1014 | mCells[iii]->insertEvent( event ); |
1015 | } | 1015 | } |
1016 | } | 1016 | } |
1017 | } else { | 1017 | } else { |
1018 | if ( invalid ) | 1018 | if ( invalid ) |
1019 | break; | 1019 | break; |
1020 | invalid = true; | 1020 | invalid = true; |
1021 | //qDebug("invalid %s", event->summary().latin1()); | 1021 | //qDebug("invalid %s", event->summary().latin1()); |
1022 | incidenceStart = QDateTime( mStartDate ); | 1022 | incidenceStart = QDateTime( mStartDate ); |
1023 | } | 1023 | } |
1024 | if ( last ) | 1024 | if ( last ) |
1025 | break; | 1025 | break; |
1026 | bool ok; | 1026 | bool ok; |
1027 | incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); | 1027 | incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); |
1028 | if ( ! ok ) | 1028 | if ( ! ok ) |
1029 | break; | 1029 | break; |
1030 | if ( incidenceStart.date() > endDate ) | 1030 | if ( incidenceStart.date() > endDate ) |
1031 | break; | 1031 | break; |
1032 | } | 1032 | } |
1033 | } else { // no recur | 1033 | } else { // no recur |
1034 | int st = event->dtStart().date().daysTo( endDate ); | 1034 | int st = event->dtStart().date().daysTo( endDate ); |
1035 | if ( st >= 0 ) { // start before timeend | 1035 | if ( st >= 0 ) { // start before timeend |
1036 | int end = mStartDate.daysTo( event->dtEnd().date() ); | 1036 | int end = mStartDate.daysTo( event->dtEnd().date() ); |
1037 | if ( end >= 0 ) { // end after timestart --- got one! | 1037 | if ( end >= 0 ) { // end after timestart --- got one! |
1038 | //normalize | 1038 | //normalize |
1039 | st = timeSpan - st; | 1039 | st = timeSpan - st; |
1040 | if ( st < 0 ) st = 0; | 1040 | if ( st < 0 ) st = 0; |
1041 | if ( end > timeSpan ) end = timeSpan; | 1041 | if ( end > timeSpan ) end = timeSpan; |
1042 | int iii; | 1042 | int iii; |
1043 | for ( iii = st;iii<= end;++iii) | 1043 | for ( iii = st;iii<= end;++iii) |
1044 | mCells[iii]->insertEvent( event ); | 1044 | mCells[iii]->insertEvent( event ); |
1045 | } | 1045 | } |
1046 | } | 1046 | } |
1047 | } | 1047 | } |
1048 | } | 1048 | } |
1049 | // insert due todos | 1049 | // insert due todos |
1050 | QPtrList<Todo> todos = calendar()->todos( ); | 1050 | QPtrList<Todo> todos = calendar()->todos( ); |
1051 | Todo *todo; | 1051 | Todo *todo; |
1052 | for(todo = todos.first(); todo; todo = todos.next()) { | 1052 | for(todo = todos.first(); todo; todo = todos.next()) { |
1053 | //insertTodo( todo ); | 1053 | //insertTodo( todo ); |
1054 | if ( todo->hasDueDate() ) { | 1054 | if ( todo->hasDueDate() ) { |
1055 | int day = mStartDate.daysTo( todo->dtDue().date() ); | 1055 | int day = mStartDate.daysTo( todo->dtDue().date() ); |
1056 | if ( day >= 0 && day < mCells.size() ) { | 1056 | if ( day >= 0 && day < mCells.size() ) { |
1057 | mCells[day]->insertTodo( todo ); | 1057 | mCells[day]->insertTodo( todo ); |
1058 | } | 1058 | } |
1059 | } | 1059 | } |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | for( i = 0; i < mCells.count(); ++i ) { | 1062 | for( i = 0; i < mCells.count(); ++i ) { |
1063 | mCells[i]->finishUpdateCell(); | 1063 | mCells[i]->finishUpdateCell(); |
1064 | } | 1064 | } |
1065 | processSelectionChange(); | 1065 | processSelectionChange(); |
1066 | mCells[0]->setFocus(); | 1066 | mCells[0]->setFocus(); |
1067 | 1067 | ||
1068 | 1068 | ||
1069 | #else | 1069 | #else |
1070 | // old code | 1070 | // old code |
1071 | //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); | 1071 | //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); |
1072 | int i; | 1072 | int i; |
1073 | for( i = 0; i < mCells.count(); ++i ) { | 1073 | for( i = 0; i < mCells.count(); ++i ) { |
1074 | mCells[i]->updateCell(); | 1074 | mCells[i]->updateCell(); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | //qDebug("KOMonthView::updateView() "); | 1077 | //qDebug("KOMonthView::updateView() "); |
1078 | processSelectionChange(); | 1078 | processSelectionChange(); |
1079 | // qDebug("---------------------------------------------------------------------+ "); | 1079 | // qDebug("---------------------------------------------------------------------+ "); |
1080 | mCells[0]->setFocus(); | 1080 | mCells[0]->setFocus(); |
1081 | #endif | 1081 | #endif |
1082 | 1082 | ||
1083 | qDebug("update time %d ", ti.elapsed()); | 1083 | //qDebug("update time %d ", ti.elapsed()); |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | void KOMonthView::resizeEvent(QResizeEvent * e) | 1086 | void KOMonthView::resizeEvent(QResizeEvent * e) |
1087 | { | 1087 | { |
1088 | computeLayout(); | 1088 | computeLayout(); |
1089 | mCells[0]->setFocus(); | 1089 | mCells[0]->setFocus(); |
1090 | } | 1090 | } |
1091 | void KOMonthView::computeLayout() | 1091 | void KOMonthView::computeLayout() |
1092 | { | 1092 | { |
1093 | // select the appropriate heading string size. E.g. "Wednesday" or "Wed". | 1093 | // select the appropriate heading string size. E.g. "Wednesday" or "Wed". |
1094 | // note this only changes the text if the requested size crosses the | 1094 | // note this only changes the text if the requested size crosses the |
1095 | // threshold between big enough to support the full name and not big | 1095 | // threshold between big enough to support the full name and not big |
1096 | // enough. | 1096 | // enough. |
1097 | 1097 | ||
1098 | int daysToShow = 7; | 1098 | int daysToShow = 7; |
1099 | bool combinedSatSun = false; | 1099 | bool combinedSatSun = false; |
1100 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1100 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1101 | daysToShow = 6; | 1101 | daysToShow = 6; |
1102 | combinedSatSun = true; | 1102 | combinedSatSun = true; |
1103 | } | 1103 | } |
1104 | int tWid = topLevelWidget()->size().width(); | 1104 | int tWid = topLevelWidget()->size().width(); |
1105 | int tHei = topLevelWidget()->size().height(); | 1105 | int tHei = topLevelWidget()->size().height(); |
1106 | 1106 | ||
1107 | int wid = size().width();//e | 1107 | int wid = size().width();//e |
1108 | int hei = size().height()-1; | 1108 | int hei = size().height()-1; |
1109 | 1109 | ||
1110 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) | 1110 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) |
1111 | return; | 1111 | return; |
1112 | //qDebug("KOMonthView::computeLayout()------------------------------------ "); | 1112 | //qDebug("KOMonthView::computeLayout()------------------------------------ "); |
1113 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1113 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1114 | int weeklabelwid = fm.width( "888" ); | 1114 | int weeklabelwid = fm.width( "888" ); |
1115 | wid -= weeklabelwid; | 1115 | wid -= weeklabelwid; |
1116 | 1116 | ||
1117 | int colWid = wid / daysToShow; | 1117 | int colWid = wid / daysToShow; |
1118 | int lastCol = wid - ( colWid*6 ); | 1118 | int lastCol = wid - ( colWid*6 ); |
1119 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); | 1119 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); |
1120 | int cellHei = (hei - dayLabelHei) /6; | 1120 | int cellHei = (hei - dayLabelHei) /6; |
1121 | int colModulo = wid % daysToShow; | 1121 | int colModulo = wid % daysToShow; |
1122 | int rowModulo = (hei- dayLabelHei) % 6; | 1122 | int rowModulo = (hei- dayLabelHei) % 6; |
1123 | //qDebug("rowmod %d ", rowModulo); | 1123 | //qDebug("rowmod %d ", rowModulo); |
1124 | int i; | 1124 | int i; |
1125 | int x,y,w,h; | 1125 | int x,y,w,h; |
1126 | x= 0; | 1126 | x= 0; |
1127 | y= 0; | 1127 | y= 0; |
1128 | w = colWid; | 1128 | w = colWid; |
1129 | h = dayLabelHei ; | 1129 | h = dayLabelHei ; |
1130 | for ( i = 0; i < 7; i++) { | 1130 | for ( i = 0; i < 7; i++) { |
1131 | if ( i == daysToShow-colModulo ) | 1131 | if ( i == daysToShow-colModulo ) |
1132 | ++w; | 1132 | ++w; |
1133 | if ( combinedSatSun ) { | 1133 | if ( combinedSatSun ) { |
1134 | if ( i >= daysToShow-1 ) { | 1134 | if ( i >= daysToShow-1 ) { |
1135 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); | 1135 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); |
1136 | x -= w/2 ; | 1136 | x -= w/2 ; |
1137 | } | 1137 | } |
1138 | else | 1138 | else |
1139 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); | 1139 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); |
1140 | } else | 1140 | } else |
1141 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); | 1141 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); |
1142 | x += w; | 1142 | x += w; |
1143 | } | 1143 | } |
1144 | x= 0; | 1144 | x= 0; |
1145 | y= dayLabelHei; | 1145 | y= dayLabelHei; |
1146 | w = colWid; | 1146 | w = colWid; |
1147 | h = cellHei ; | 1147 | h = cellHei ; |
1148 | for ( i = 0; i < mCells.count(); ++i) { | 1148 | for ( i = 0; i < mCells.count(); ++i) { |
1149 | 1149 | ||
1150 | w = colWid; | 1150 | w = colWid; |
1151 | if ( ((i) % 7) >= 7-colModulo ) { | 1151 | if ( ((i) % 7) >= 7-colModulo ) { |
1152 | ++w; | 1152 | ++w; |
1153 | } | 1153 | } |
1154 | if ( i == (6-rowModulo)*7) | 1154 | if ( i == (6-rowModulo)*7) |
1155 | ++h; | 1155 | ++h; |
1156 | if ( combinedSatSun ) { | 1156 | if ( combinedSatSun ) { |
1157 | if ( (i)%7 >= daysToShow-1 ) { | 1157 | if ( (i)%7 >= daysToShow-1 ) { |
1158 | if ( (i)%7 == daysToShow-1 ) { | 1158 | if ( (i)%7 == daysToShow-1 ) { |
1159 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); | 1159 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); |
1160 | x -= w ;y += h/2; | 1160 | x -= w ;y += h/2; |
1161 | } else { | 1161 | } else { |
1162 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); | 1162 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); |
1163 | y -= h/2; | 1163 | y -= h/2; |
1164 | } | 1164 | } |
1165 | } else | 1165 | } else |
1166 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); | 1166 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); |
1167 | 1167 | ||
1168 | } | 1168 | } |
1169 | else | 1169 | else |
1170 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); | 1170 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); |
1171 | x += w; | 1171 | x += w; |
1172 | if ( x + w/2 > wid ) { | 1172 | if ( x + w/2 > wid ) { |
1173 | x = 0; | 1173 | x = 0; |
1174 | y += h; | 1174 | y += h; |
1175 | } | 1175 | } |
1176 | } | 1176 | } |
1177 | y= dayLabelHei; | 1177 | y= dayLabelHei; |
1178 | h = cellHei ; | 1178 | h = cellHei ; |
1179 | for ( i = 0; i < 6; i++) { | 1179 | for ( i = 0; i < 6; i++) { |