-rw-r--r-- | korganizer/navigatorbar.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 2406bb5..24de01f 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -133,23 +133,31 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam if ( QApplication::desktop()->width() >= 480 ) { size += 6; maxwidth+= 6; } if ( insertWeek ) { - //shit : bug in Qt. after inserting 53 item, only 51 are shown... QPopupMenu * wpo = new QPopupMenu (this); - wpo->insertItem( i18n("W#"), 0 ); - for ( i = 1; i < 53; ++i ) { + QPopupMenu * all = new QPopupMenu (this); + //wpo->insertItem( i18n("W#"), 0 ); + int first = 1; + for ( i = 1; i < 50; ++i ) { + if ( !(i%10) ) { + all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); + connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); + first = i; + wpo = new QPopupMenu (this); + } wpo->insertItem( QString::number(i), i ); } - for ( i = 53; i < 54; ++i ) { - wpo->insertItem( "", 52 ); + for ( i = 50; i < 53; ++i ) { + wpo->insertItem( QString::number(i), i); } - selWeek->setPopup( wpo ); - selWeek->setFixedWidth( (size/4)*3 ); + all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); + selWeek->setPopup( all ); + selWeek->setFixedWidth( (size/5)*4 ); selWeek->setFixedHeight( size ); connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); } mSelectMonth->setFixedWidth( maxwidth ); mSelectMonth->setFixedHeight( size ); mPrevYear->setFixedHeight( size ); |