-rw-r--r-- | korganizer/navigatorbar.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 49149f2..0610d55 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -84,109 +84,110 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam // Create forward navigation buttons mNextMonth = new QPushButton( mCtrlFrame ); mNextMonth->setPixmap( SmallIcon( isDesktop ? "2rightarrowB" : "2rightarrow") ); QToolTip::add( mNextMonth, i18n("Next Month") ); mPrevWeek = new QPushButton( mCtrlFrame ); mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); QToolTip::add( mPrevWeek, i18n("Previous Week") ); // Create forward navigation buttons mNextWeek = new QPushButton( mCtrlFrame ); mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); QToolTip::add( mNextWeek, i18n("Next Week") ); mNextYear = new QPushButton( mCtrlFrame ); mNextYear->setPixmap( SmallIcon( isDesktop ? "3rightarrowB": "3rightarrow") ); QToolTip::add( mNextYear, i18n("Next Year") ); mSelectMonth = new QPushButton( mCtrlFrame ); // Create month name label //selectMonth->setFont( tfont ); // selectMonth->setAlignment( AlignCenter ); //mDateLabel = new QLabel( selectMonth ); //mDateLabel->setFont( tfont ); //mDateLabel->setAlignment( AlignCenter ); if ( QString ( name ) == QString("useBigPixmaps") ) { mNextMonth->setFlat( true); mNextWeek->setFlat( true); mNextYear->setFlat( true); mSelectMonth->setFlat( true); mPrevYear->setFlat( true); mPrevMonth->setFlat( true); mPrevWeek->setFlat( true); + + mPrevYear->setAutoRepeat( true ); + mPrevMonth->setAutoRepeat( true ); + mNextMonth->setAutoRepeat( true ); + mPrevWeek->setAutoRepeat( true ); + mNextWeek->setAutoRepeat( true ); + mNextYear->setAutoRepeat( true ); } else { mPrevWeek->hide(); mNextWeek->hide(); } resetFont( font() ); // set up control frame layout QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); ctrlLayout->addWidget( mPrevYear, 3 ); ctrlLayout->addWidget( mPrevMonth, 3 ); ctrlLayout->addWidget( mPrevWeek, 3 ); //ctrlLayout->addStretch( 1 ); // ctrlLayout->addSpacing( 1 ); // ctrlLayout->addWidget( mDateLabel ); ctrlLayout->addWidget( mSelectMonth ); // ctrlLayout->addSpacing( 1 ); // ctrlLayout->addStretch( 1 ); ctrlLayout->addWidget( mNextWeek, 3 ); ctrlLayout->addWidget( mNextMonth, 3 ); ctrlLayout->addWidget( mNextYear, 3 ); connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); mPrevYear->setFocusPolicy(NoFocus); mPrevMonth->setFocusPolicy(NoFocus); mNextMonth->setFocusPolicy(NoFocus); mPrevWeek->setFocusPolicy(NoFocus); mNextWeek->setFocusPolicy(NoFocus); mNextYear->setFocusPolicy(NoFocus); mSelectMonth->setFocusPolicy(NoFocus); setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); - mPrevYear->setAutoRepeat( true ); - mPrevMonth->setAutoRepeat( true ); - mNextMonth->setAutoRepeat( true ); - mPrevWeek->setAutoRepeat( true ); - mNextWeek->setAutoRepeat( true ); - mNextYear->setAutoRepeat( true ); - + } NavigatorBar::~NavigatorBar() { } QSize NavigatorBar::sizeHint() const { int wid = mCurrentMinWid ; if ( mPrevYear->isVisible() ) wid += mCurrentButtonMinWid; if ( mPrevMonth->isVisible() ) wid += mCurrentButtonMinWid; if ( mPrevWeek->isVisible() ) wid += mCurrentButtonMinWid; if ( mNextMonth->isVisible() ) wid += mCurrentButtonMinWid; if ( mNextWeek->isVisible() ) wid += mCurrentButtonMinWid; if ( mNextYear->isVisible() ) wid += mCurrentButtonMinWid; //qDebug("ret %d %d ", wid, mCurrentHei); return QSize ( wid, mCurrentHei ); } QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const { return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei ); } void NavigatorBar::resetFont ( QFont fo ) { QFont tfont = fo; if ( QApplication::desktop()->width() >= 480 ) |