author | zautrix <zautrix> | 2005-03-24 11:39:34 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-24 11:39:34 (UTC) |
commit | a9e8535fd6960f454ab7009cfa996973291502a2 (patch) (side-by-side diff) | |
tree | bcef1497b415a0b1a667c896f1fe7a4d4a764425 | |
parent | b9e83e4536ee4fc34b882fb88b8e5fd00bfdf929 (diff) | |
download | kdepimpi-a9e8535fd6960f454ab7009cfa996973291502a2.zip kdepimpi-a9e8535fd6960f454ab7009cfa996973291502a2.tar.gz kdepimpi-a9e8535fd6960f454ab7009cfa996973291502a2.tar.bz2 |
layout fix
-rw-r--r-- | korganizer/kdatenavigator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 1474e4b..d62402f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -42,112 +42,113 @@ #include <kcalendarsystem.h> #include "navigatorbar.h" #include "kdatenavigator.h" KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) : QFrame(parent, name), updateTimer(0L) { setFrameStyle(QFrame::NoFrame); QDate startDate = QDate::currentDate(); QGridLayout *topLayout = new QGridLayout(this,8,8); if (! startDate.isValid()) { qDebug("KDateNavigator::invalid startdate "); startDate = QDate::currentDate(); } mMonthSignalOffset = 0; mSelectedDates.append(startDate); m_MthYr = startDate; m_bShowWeekNums = true; setFont( KOPrefs::instance()->mDateNavigatorFont ); mNavigatorBar = new NavigatorBar( startDate, this ); topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); //mNavigatorBar->resize( 1,1); connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); - + // get the day of the week on the first day QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); m_fstDayOfWk = dayone.dayOfWeek(); int i; // Set up the heading fields. for( i = 0; i < 7; i++ ) { headings[i] = new QLabel("",this); //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); headings[i]->setAlignment(AlignCenter); headings[i]->installEventFilter(this); topLayout->addWidget(headings[i],1,i+1); } // Create the weeknumber labels for( i = 0; i < 6; i++ ) { weeknos[i] = new QLabel(this); weeknos[i]->setAlignment(AlignCenter); //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 = sizeHintTwoButtons(); myFullSizeHint = sizeHintTwoButtons( 4 ); mFontChanged = false; + resize ( mySizeHint ); } 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( 2 ); //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()) { if ( si.width() / sh.width() == 1 ) { if ( si.width() < sizeHintTwoButtons( 4 ).width()) continue; } *b = true; //qDebug("fooooooooooooooooooooooouuuuund "); break; } } //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); return fo; } |