author | zautrix <zautrix> | 2005-03-21 13:08:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-21 13:08:02 (UTC) |
commit | 098a3c6dd844a880beb2851be53314613c3a038d (patch) (unidiff) | |
tree | bac6a915e906760c48b1756c5b0564b04def0b63 /korganizer | |
parent | ad4ecbb0cbf79f37140041eb9a14e71e6fd393f1 (diff) | |
download | kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.zip kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.tar.gz kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.tar.bz2 |
fixes
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 3 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 2 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 5941337..d4173e8 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -139,49 +139,50 @@ void DateNavigatorContainer::setBaseDates() | |||
139 | { | 139 | { |
140 | KCal::DateList dateList = mNavigatorView->selectedDates(); | 140 | KCal::DateList dateList = mNavigatorView->selectedDates(); |
141 | if ( dateList.isEmpty() ) { | 141 | if ( dateList.isEmpty() ) { |
142 | kdError() << "DateNavigatorContainer::selectDates() empty list." << endl; | 142 | kdError() << "DateNavigatorContainer::selectDates() empty list." << endl; |
143 | } | 143 | } |
144 | QDate baseDate = dateList.first(); | 144 | QDate baseDate = dateList.first(); |
145 | KDateNavigator *n; | 145 | KDateNavigator *n; |
146 | bool doRepaint = false; // skip first repaint | 146 | bool doRepaint = false; // skip first repaint |
147 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { | 147 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { |
148 | baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 ); | 148 | baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 ); |
149 | n->setBaseDate( baseDate, doRepaint ); | 149 | n->setBaseDate( baseDate, doRepaint ); |
150 | doRepaint = true; | 150 | doRepaint = true; |
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
154 | void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) | 154 | void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) |
155 | { | 155 | { |
156 | #if 0 | 156 | #if 0 |
157 | kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl; | 157 | kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl; |
158 | kdDebug(5850) << " CURRENT SIZE: " << size() << endl; | 158 | kdDebug(5850) << " CURRENT SIZE: " << size() << endl; |
159 | kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl; | 159 | kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl; |
160 | kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl; | 160 | kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl; |
161 | kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl; | 161 | kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl; |
162 | #endif | 162 | #endif |
163 | QSize minSize = mNavigatorView->sizeHintTwoButtons(); | 163 | //QSize minSize = mNavigatorView->sizeHintTwoButtons(); |
164 | QSize minSize = mNavigatorView->yourSizeHint(); | ||
164 | 165 | ||
165 | // kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl; | 166 | // kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl; |
166 | 167 | ||
167 | int verticalCount = size().height() / minSize.height(); | 168 | int verticalCount = size().height() / minSize.height(); |
168 | int horizontalCount = size().width() / minSize.width(); | 169 | int horizontalCount = size().width() / minSize.width(); |
169 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); | 170 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); |
170 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); | 171 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); |
171 | bool fontchange = false; | 172 | bool fontchange = false; |
172 | QFont fo; | 173 | QFont fo; |
173 | if ( horizontalCount != mHorizontalCount || | 174 | if ( horizontalCount != mHorizontalCount || |
174 | verticalCount != mVerticalCount ) { | 175 | verticalCount != mVerticalCount ) { |
175 | uint count = horizontalCount * verticalCount; | 176 | uint count = horizontalCount * verticalCount; |
176 | if ( count == 0 ) { | 177 | if ( count == 0 ) { |
177 | bool ok; | 178 | bool ok; |
178 | fo = mNavigatorView->yourFontHint( size() , &ok); | 179 | fo = mNavigatorView->yourFontHint( size() , &ok); |
179 | //mNavigatorView->resize( size() ); | 180 | //mNavigatorView->resize( size() ); |
180 | //if ( ! ok ) | 181 | //if ( ! ok ) |
181 | // return; | 182 | // return; |
182 | minSize = mNavigatorView->sizeHintTwoButtons(); | 183 | minSize = mNavigatorView->sizeHintTwoButtons(); |
183 | verticalCount = size().height() / minSize.height(); | 184 | verticalCount = size().height() / minSize.height(); |
184 | horizontalCount = size().width() / minSize.width(); | 185 | horizontalCount = size().width() / minSize.width(); |
185 | if ( horizontalCount == 0 ) | 186 | if ( horizontalCount == 0 ) |
186 | horizontalCount = 1; | 187 | horizontalCount = 1; |
187 | if ( verticalCount == 0 ) | 188 | if ( verticalCount == 0 ) |
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index a5dbc5d..4b50b5a 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -94,49 +94,49 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
94 | //weeknos[i]->setFont(QFont("Arial", 10)); | 94 | //weeknos[i]->setFont(QFont("Arial", 10)); |
95 | if(!m_bShowWeekNums) { | 95 | if(!m_bShowWeekNums) { |
96 | weeknos[i]->hide(); | 96 | weeknos[i]->hide(); |
97 | } | 97 | } |
98 | weeknos[i]->installEventFilter(this); | 98 | weeknos[i]->installEventFilter(this); |
99 | 99 | ||
100 | topLayout->addWidget(weeknos[i],i+2,0); | 100 | topLayout->addWidget(weeknos[i],i+2,0); |
101 | } | 101 | } |
102 | 102 | ||
103 | daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); | 103 | daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); |
104 | daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 104 | daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); |
105 | daymatrix->setLineWidth(1); | 105 | daymatrix->setLineWidth(1); |
106 | 106 | ||
107 | connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), | 107 | connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), |
108 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); | 108 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); |
109 | 109 | ||
110 | connect( daymatrix, SIGNAL( eventDropped( Event * ) ), | 110 | connect( daymatrix, SIGNAL( eventDropped( Event * ) ), |
111 | SIGNAL( eventDropped( Event * ) ) ); | 111 | SIGNAL( eventDropped( Event * ) ) ); |
112 | 112 | ||
113 | topLayout->addMultiCellWidget(daymatrix,2,7,1,7); | 113 | topLayout->addMultiCellWidget(daymatrix,2,7,1,7); |
114 | 114 | ||
115 | // read settings from configuration file. | 115 | // read settings from configuration file. |
116 | updateConfig(); | 116 | updateConfig(); |
117 | enableRollover(FollowMonth); | 117 | enableRollover(FollowMonth); |
118 | mySizeHint = sizeHint(); | 118 | mySizeHint = sizeHintTwoButtons(); |
119 | mFontChanged = false; | 119 | mFontChanged = false; |
120 | } | 120 | } |
121 | void KDateNavigator::changeFont ( QFont fo ) | 121 | void KDateNavigator::changeFont ( QFont fo ) |
122 | { | 122 | { |
123 | setFont( fo ); | 123 | setFont( fo ); |
124 | mNavigatorBar->resetFont( fo ); | 124 | mNavigatorBar->resetFont( fo ); |
125 | } | 125 | } |
126 | QFont KDateNavigator::yourFontHint( QSize si , bool *b) | 126 | QFont KDateNavigator::yourFontHint( QSize si , bool *b) |
127 | { | 127 | { |
128 | QFont fo = KOPrefs::instance()->mDateNavigatorFont; | 128 | QFont fo = KOPrefs::instance()->mDateNavigatorFont; |
129 | *b = false; | 129 | *b = false; |
130 | int fontPoint = fo.pointSize(); | 130 | int fontPoint = fo.pointSize(); |
131 | while ( fontPoint > 5 ) { | 131 | while ( fontPoint > 5 ) { |
132 | --fontPoint; | 132 | --fontPoint; |
133 | fo.setPointSize( fontPoint ); | 133 | fo.setPointSize( fontPoint ); |
134 | setFont( fo ); | 134 | setFont( fo ); |
135 | mFontChanged = true; | 135 | mFontChanged = true; |
136 | mNavigatorBar->resetFont( fo ); | 136 | mNavigatorBar->resetFont( fo ); |
137 | QSize sh = sizeHintTwoButtons(); | 137 | QSize sh = sizeHintTwoButtons(); |
138 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); | 138 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); |
139 | if ( si.width() > sh.width() && si.height() > sh.height()) { | 139 | if ( si.width() > sh.width() && si.height() > sh.height()) { |
140 | *b = true; | 140 | *b = true; |
141 | //qDebug("fooooooooooooooooooooooouuuuund "); | 141 | //qDebug("fooooooooooooooooooooooouuuuund "); |
142 | break; | 142 | break; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 582b2ef..9baff20 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -424,59 +424,59 @@ void KODayMatrix::updateEvents() | |||
424 | if ( !mCalendar ) return; | 424 | if ( !mCalendar ) return; |
425 | 425 | ||
426 | for( int i = 0; i < NUMDAYS; i++ ) { | 426 | for( int i = 0; i < NUMDAYS; i++ ) { |
427 | // if events are set for the day then remember to draw it bold | 427 | // if events are set for the day then remember to draw it bold |
428 | QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); | 428 | QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); |
429 | int numEvents = eventlist.count(); | 429 | int numEvents = eventlist.count(); |
430 | Event *event; | 430 | Event *event; |
431 | for( event = eventlist.first(); event != 0;event=eventlist.next()) { | 431 | for( event = eventlist.first(); event != 0;event=eventlist.next()) { |
432 | ushort recurType = event->doesRecur(); | 432 | ushort recurType = event->doesRecur(); |
433 | 433 | ||
434 | if ( ( recurType == Recurrence::rDaily && | 434 | if ( ( recurType == Recurrence::rDaily && |
435 | !KOPrefs::instance()->mDailyRecur ) || | 435 | !KOPrefs::instance()->mDailyRecur ) || |
436 | ( recurType == Recurrence::rWeekly && | 436 | ( recurType == Recurrence::rWeekly && |
437 | !KOPrefs::instance()->mWeeklyRecur ) ) { | 437 | !KOPrefs::instance()->mWeeklyRecur ) ) { |
438 | numEvents--; | 438 | numEvents--; |
439 | } | 439 | } |
440 | } | 440 | } |
441 | events[ i ] = numEvents; | 441 | events[ i ] = numEvents; |
442 | } | 442 | } |
443 | } | 443 | } |
444 | 444 | ||
445 | const QDate& KODayMatrix::getDate(int offset) | 445 | const QDate& KODayMatrix::getDate(int offset) |
446 | { | 446 | { |
447 | if (offset < 0 || offset > NUMDAYS-1) { | 447 | if (offset < 0 || offset > NUMDAYS-1) { |
448 | qDebug("Wrong offset2 "); | 448 | qDebug("Wrong offset2 %d", offset); |
449 | return days[0]; | 449 | return days[0]; |
450 | } | 450 | } |
451 | return days[offset]; | 451 | return days[offset]; |
452 | } | 452 | } |
453 | 453 | ||
454 | QString KODayMatrix::getHolidayLabel(int offset) | 454 | QString KODayMatrix::getHolidayLabel(int offset) |
455 | { | 455 | { |
456 | if (offset < 0 || offset > NUMDAYS-1) { | 456 | if (offset < 0 || offset > NUMDAYS-1) { |
457 | qDebug("Wrong offset1 "); | 457 | qDebug("Wrong offset1 %d", offset); |
458 | return 0; | 458 | return QString(); |
459 | } | 459 | } |
460 | return mHolidays[offset]; | 460 | return mHolidays[offset]; |
461 | } | 461 | } |
462 | 462 | ||
463 | int KODayMatrix::getDayIndexFrom(int x, int y) | 463 | int KODayMatrix::getDayIndexFrom(int x, int y) |
464 | { | 464 | { |
465 | int colModulo = (width()-2) % 7; | 465 | int colModulo = (width()-2) % 7; |
466 | int rowModulo = (height()-2) % 6; | 466 | int rowModulo = (height()-2) % 6; |
467 | #if 0 | 467 | #if 0 |
468 | return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ? | 468 | return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ? |
469 | 6 - x/daysize.width() : x/daysize.width()); | 469 | 6 - x/daysize.width() : x/daysize.width()); |
470 | #endif | 470 | #endif |
471 | int xVal = (x-colModulo/2-2)/daysize.width(); | 471 | int xVal = (x-colModulo/2-2)/daysize.width(); |
472 | int yVal = (y-rowModulo/2-2)/daysize.height(); | 472 | int yVal = (y-rowModulo/2-2)/daysize.height(); |
473 | 473 | ||
474 | 474 | ||
475 | return 7*(yVal) + xVal; | 475 | return 7*(yVal) + xVal; |
476 | 476 | ||
477 | } | 477 | } |
478 | 478 | ||
479 | // ---------------------------------------------------------------------------- | 479 | // ---------------------------------------------------------------------------- |
480 | // M O U S E E V E N T H A N D L I N G | 480 | // M O U S E E V E N T H A N D L I N G |
481 | // ---------------------------------------------------------------------------- | 481 | // ---------------------------------------------------------------------------- |
482 | 482 | ||