summaryrefslogtreecommitdiffabout
path: root/korganizer/navigatorbar.cpp
Unidiff
Diffstat (limited to 'korganizer/navigatorbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/navigatorbar.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index b591232..934e153 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -89,6 +89,15 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
89 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); 89 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
90 QToolTip::add( mNextMonth, i18n("Next Month") ); 90 QToolTip::add( mNextMonth, i18n("Next Month") );
91 91
92 mPrevWeek = new QPushButton( mCtrlFrame );
93 mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
94 QToolTip::add( mPrevWeek, i18n("Previous Week") );
95
96 // Create forward navigation buttons
97 mNextWeek = new QPushButton( mCtrlFrame );
98 mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
99 QToolTip::add( mNextWeek, i18n("Next Week") );
100
92 mNextYear = new QPushButton( mCtrlFrame ); 101 mNextYear = new QPushButton( mCtrlFrame );
93 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); 102 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") );
94 QToolTip::add( mNextYear, i18n("Next Year") ); 103 QToolTip::add( mNextYear, i18n("Next Year") );
@@ -101,10 +110,15 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
101 //mDateLabel->setAlignment( AlignCenter ); 110 //mDateLabel->setAlignment( AlignCenter );
102 if ( QString ( name ) == QString("useBigPixmaps") ) { 111 if ( QString ( name ) == QString("useBigPixmaps") ) {
103 mNextMonth->setFlat( true); 112 mNextMonth->setFlat( true);
113 mNextWeek->setFlat( true);
104 mNextYear->setFlat( true); 114 mNextYear->setFlat( true);
105 mSelectMonth->setFlat( true); 115 mSelectMonth->setFlat( true);
106 mPrevYear->setFlat( true); 116 mPrevYear->setFlat( true);
107 mPrevMonth->setFlat( true); 117 mPrevMonth->setFlat( true);
118 mPrevWeek->setFlat( true);
119 } else {
120 mPrevWeek->hide();
121 mNextWeek->hide();
108 } 122 }
109 mSelectMonth->setFont( tfont ); 123 mSelectMonth->setFont( tfont );
110 // Set minimum width to width of widest month name label 124 // Set minimum width to width of widest month name label
@@ -128,31 +142,39 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
128 142
129 mSelectMonth->setFixedWidth( maxwidth ); 143 mSelectMonth->setFixedWidth( maxwidth );
130 mSelectMonth->setFixedHeight( size ); 144 mSelectMonth->setFixedHeight( size );
131 mPrevYear->setFixedHeight( size ); 145 mPrevYear->setFixedHeight( size );
132 mPrevMonth->setFixedHeight( size ); 146 mPrevMonth->setFixedHeight( size );
133 mNextMonth->setFixedHeight( size ); 147 mPrevWeek->setFixedHeight( size );
148 mNextMonth->setFixedHeight( size );
149 mNextWeek->setFixedHeight( size );
134 mNextYear->setFixedHeight ( size ); 150 mNextYear->setFixedHeight ( size );
135 // set up control frame layout 151 // set up control frame layout
136 QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); 152 QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 );
137 ctrlLayout->addWidget( mPrevYear, 3 ); 153 ctrlLayout->addWidget( mPrevYear, 3 );
138 ctrlLayout->addWidget( mPrevMonth, 3 ); 154 ctrlLayout->addWidget( mPrevMonth, 3 );
155 ctrlLayout->addWidget( mPrevWeek, 3 );
139 //ctrlLayout->addStretch( 1 ); 156 //ctrlLayout->addStretch( 1 );
140 // ctrlLayout->addSpacing( 1 ); 157 // ctrlLayout->addSpacing( 1 );
141 // ctrlLayout->addWidget( mDateLabel ); 158 // ctrlLayout->addWidget( mDateLabel );
142 ctrlLayout->addWidget( mSelectMonth ); 159 ctrlLayout->addWidget( mSelectMonth );
143 // ctrlLayout->addSpacing( 1 ); 160 // ctrlLayout->addSpacing( 1 );
144 // ctrlLayout->addStretch( 1 ); 161 // ctrlLayout->addStretch( 1 );
162 ctrlLayout->addWidget( mNextWeek, 3 );
145 ctrlLayout->addWidget( mNextMonth, 3 ); 163 ctrlLayout->addWidget( mNextMonth, 3 );
146 ctrlLayout->addWidget( mNextYear, 3 ); 164 ctrlLayout->addWidget( mNextYear, 3 );
147 165
148 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); 166 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) );
149 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); 167 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) );
150 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); 168 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) );
169 connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) );
170 connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) );
151 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); 171 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) );
152 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); 172 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) );
153 mPrevYear->setFocusPolicy(NoFocus); 173 mPrevYear->setFocusPolicy(NoFocus);
154 mPrevMonth->setFocusPolicy(NoFocus); 174 mPrevMonth->setFocusPolicy(NoFocus);
155 mNextMonth->setFocusPolicy(NoFocus); 175 mNextMonth->setFocusPolicy(NoFocus);
176 mPrevWeek->setFocusPolicy(NoFocus);
177 mNextWeek->setFocusPolicy(NoFocus);
156 mNextYear->setFocusPolicy(NoFocus); 178 mNextYear->setFocusPolicy(NoFocus);
157 mSelectMonth->setFocusPolicy(NoFocus); 179 mSelectMonth->setFocusPolicy(NoFocus);
158 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); 180 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );