summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-21 13:08:02 (UTC)
committer zautrix <zautrix>2005-03-21 13:08:02 (UTC)
commit098a3c6dd844a880beb2851be53314613c3a038d (patch) (side-by-side diff)
treebac6a915e906760c48b1756c5b0564b04def0b63
parentad4ecbb0cbf79f37140041eb9a14e71e6fd393f1 (diff)
downloadkdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.zip
kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.tar.gz
kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.tar.bz2
fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp3
-rw-r--r--korganizer/kdatenavigator.cpp2
-rw-r--r--korganizer/kodaymatrix.cpp6
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()
{
KCal::DateList dateList = mNavigatorView->selectedDates();
if ( dateList.isEmpty() ) {
kdError() << "DateNavigatorContainer::selectDates() empty list." << endl;
}
QDate baseDate = dateList.first();
KDateNavigator *n;
bool doRepaint = false; // skip first repaint
for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 );
n->setBaseDate( baseDate, doRepaint );
doRepaint = true;
}
}
void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
{
#if 0
kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl;
kdDebug(5850) << " CURRENT SIZE: " << size() << endl;
kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl;
kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl;
kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl;
#endif
- QSize minSize = mNavigatorView->sizeHintTwoButtons();
+ //QSize minSize = mNavigatorView->sizeHintTwoButtons();
+ QSize minSize = mNavigatorView->yourSizeHint();
// kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl;
int verticalCount = size().height() / minSize.height();
int horizontalCount = size().width() / minSize.width();
//qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
//qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
bool fontchange = false;
QFont fo;
if ( horizontalCount != mHorizontalCount ||
verticalCount != mVerticalCount ) {
uint count = horizontalCount * verticalCount;
if ( count == 0 ) {
bool ok;
fo = mNavigatorView->yourFontHint( size() , &ok);
//mNavigatorView->resize( size() );
//if ( ! ok )
// return;
minSize = mNavigatorView->sizeHintTwoButtons();
verticalCount = size().height() / minSize.height();
horizontalCount = size().width() / minSize.width();
if ( horizontalCount == 0 )
horizontalCount = 1;
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 )
//weeknos[i]->setFont(QFont("Arial", 10));
if(!m_bShowWeekNums) {
weeknos[i]->hide();
}
weeknos[i]->installEventFilter(this);
topLayout->addWidget(weeknos[i],i+2,0);
}
daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
daymatrix->setLineWidth(1);
connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
SIGNAL( datesSelected( const KCal::DateList & ) ) );
connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
SIGNAL( eventDropped( Event * ) ) );
topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
// read settings from configuration file.
updateConfig();
enableRollover(FollowMonth);
- mySizeHint = sizeHint();
+ mySizeHint = sizeHintTwoButtons();
mFontChanged = false;
}
void KDateNavigator::changeFont ( QFont fo )
{
setFont( fo );
mNavigatorBar->resetFont( fo );
}
QFont KDateNavigator::yourFontHint( QSize si , bool *b)
{
QFont fo = KOPrefs::instance()->mDateNavigatorFont;
*b = false;
int fontPoint = fo.pointSize();
while ( fontPoint > 5 ) {
--fontPoint;
fo.setPointSize( fontPoint );
setFont( fo );
mFontChanged = true;
mNavigatorBar->resetFont( fo );
QSize sh = sizeHintTwoButtons();
//qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
if ( si.width() > sh.width() && si.height() > sh.height()) {
*b = true;
//qDebug("fooooooooooooooooooooooouuuuund ");
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()
if ( !mCalendar ) return;
for( int i = 0; i < NUMDAYS; i++ ) {
// if events are set for the day then remember to draw it bold
QPtrList<Event> eventlist = mCalendar->events( days[ i ] );
int numEvents = eventlist.count();
Event *event;
for( event = eventlist.first(); event != 0;event=eventlist.next()) {
ushort recurType = event->doesRecur();
if ( ( recurType == Recurrence::rDaily &&
!KOPrefs::instance()->mDailyRecur ) ||
( recurType == Recurrence::rWeekly &&
!KOPrefs::instance()->mWeeklyRecur ) ) {
numEvents--;
}
}
events[ i ] = numEvents;
}
}
const QDate& KODayMatrix::getDate(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
- qDebug("Wrong offset2 ");
+ qDebug("Wrong offset2 %d", offset);
return days[0];
}
return days[offset];
}
QString KODayMatrix::getHolidayLabel(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
- qDebug("Wrong offset1 ");
- return 0;
+ qDebug("Wrong offset1 %d", offset);
+ return QString();
}
return mHolidays[offset];
}
int KODayMatrix::getDayIndexFrom(int x, int y)
{
int colModulo = (width()-2) % 7;
int rowModulo = (height()-2) % 6;
#if 0
return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ?
6 - x/daysize.width() : x/daysize.width());
#endif
int xVal = (x-colModulo/2-2)/daysize.width();
int yVal = (y-rowModulo/2-2)/daysize.height();
return 7*(yVal) + xVal;
}
// ----------------------------------------------------------------------------
// M O U S E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------