author | zautrix <zautrix> | 2005-04-01 18:10:09 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-01 18:10:09 (UTC) |
commit | edc032c21ae3788d02a632ea8066e4ac5a4feedb (patch) (unidiff) | |
tree | 8e59c8dcf1cc3021694025627d36e152f7adc389 /korganizer/navigatorbar.cpp | |
parent | 5d88f92b76a760f100384ea5fa6ed143088d19bb (diff) | |
download | kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.zip kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.gz kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.bz2 |
fixes
-rw-r--r-- | korganizer/navigatorbar.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 0610d55..b03870f 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -171,97 +171,97 @@ QSize NavigatorBar::sizeHint() const | |||
171 | wid += mCurrentButtonMinWid; | 171 | wid += mCurrentButtonMinWid; |
172 | if ( mPrevMonth->isVisible() ) | 172 | if ( mPrevMonth->isVisible() ) |
173 | wid += mCurrentButtonMinWid; | 173 | wid += mCurrentButtonMinWid; |
174 | if ( mPrevWeek->isVisible() ) | 174 | if ( mPrevWeek->isVisible() ) |
175 | wid += mCurrentButtonMinWid; | 175 | wid += mCurrentButtonMinWid; |
176 | if ( mNextMonth->isVisible() ) | 176 | if ( mNextMonth->isVisible() ) |
177 | wid += mCurrentButtonMinWid; | 177 | wid += mCurrentButtonMinWid; |
178 | if ( mNextWeek->isVisible() ) | 178 | if ( mNextWeek->isVisible() ) |
179 | wid += mCurrentButtonMinWid; | 179 | wid += mCurrentButtonMinWid; |
180 | if ( mNextYear->isVisible() ) | 180 | if ( mNextYear->isVisible() ) |
181 | wid += mCurrentButtonMinWid; | 181 | wid += mCurrentButtonMinWid; |
182 | //qDebug("ret %d %d ", wid, mCurrentHei); | 182 | //qDebug("ret %d %d ", wid, mCurrentHei); |
183 | return QSize ( wid, mCurrentHei ); | 183 | return QSize ( wid, mCurrentHei ); |
184 | } | 184 | } |
185 | QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const | 185 | QSize NavigatorBar::sizeHintTwoButtons( int butNum ) const |
186 | { | 186 | { |
187 | return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei ); | 187 | return QSize ( mCurrentMinWid + butNum * mCurrentButtonMinWid , mCurrentHei ); |
188 | } | 188 | } |
189 | void NavigatorBar::resetFont ( QFont fo ) | 189 | void NavigatorBar::resetFont ( QFont fo ) |
190 | { | 190 | { |
191 | 191 | ||
192 | QFont tfont = fo; | 192 | QFont tfont = fo; |
193 | if ( QApplication::desktop()->width() >= 480 ) | 193 | if ( QApplication::desktop()->width() >= 480 ) |
194 | tfont.setPointSize(tfont.pointSize()+2); | 194 | tfont.setPointSize(tfont.pointSize()+2); |
195 | tfont.setBold(true); | 195 | tfont.setBold(true); |
196 | 196 | ||
197 | mSelectMonth->setFont( tfont ); | 197 | mSelectMonth->setFont( tfont ); |
198 | // Set minimum width to width of widest month name label | 198 | // Set minimum width to width of widest month name label |
199 | int i; | 199 | int i; |
200 | int maxwidth = 0; | 200 | int maxwidth = 0; |
201 | QFontMetrics fm ( mSelectMonth->font() ); | 201 | QFontMetrics fm ( mSelectMonth->font() ); |
202 | int width = fm.width("September '00" ); | 202 | int width = fm.width("September '00" ); |
203 | maxwidth = width+2; | 203 | maxwidth = width+2; |
204 | int size = fm.height()+2; | 204 | int size = fm.height()+2; |
205 | if ( QApplication::desktop()->width() >= 480 ) { | 205 | if ( QApplication::desktop()->width() >= 480 ) { |
206 | size += 6; | 206 | size += 6; |
207 | maxwidth+= 6; | 207 | maxwidth+= 6; |
208 | } | 208 | } |
209 | mSelectMonth->setMinimumWidth( maxwidth ); | 209 | mSelectMonth->setMinimumWidth( maxwidth ); |
210 | mSelectMonth->setFixedHeight( size ); | 210 | mSelectMonth->setFixedHeight( size ); |
211 | mPrevYear->setFixedHeight( size ); | 211 | mPrevYear->setFixedHeight( size ); |
212 | mPrevMonth->setFixedHeight( size ); | 212 | mPrevMonth->setFixedHeight( size ); |
213 | mPrevWeek->setFixedHeight( size ); | 213 | mPrevWeek->setFixedHeight( size ); |
214 | mNextMonth->setFixedHeight( size ); | 214 | mNextMonth->setFixedHeight( size ); |
215 | mNextWeek->setFixedHeight( size ); | 215 | mNextWeek->setFixedHeight( size ); |
216 | mNextYear->setFixedHeight ( size ); | 216 | mNextYear->setFixedHeight ( size ); |
217 | mCurrentHei = size +2; | 217 | mCurrentHei = size +2; |
218 | mCurrentMinWid = maxwidth+2; | 218 | mCurrentMinWid = maxwidth+2; |
219 | mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2; | 219 | mCurrentButtonMinWid = mPrevYear->sizeHint().width(); |
220 | } | 220 | } |
221 | 221 | ||
222 | void NavigatorBar::showButtons( bool left, bool right ) | 222 | void NavigatorBar::showButtons( bool left, bool right ) |
223 | { | 223 | { |
224 | if ( left ) { | 224 | if ( left ) { |
225 | mPrevYear->show(); | 225 | mPrevYear->show(); |
226 | mPrevMonth->show(); | 226 | mPrevMonth->show(); |
227 | } else { | 227 | } else { |
228 | mPrevYear->hide(); | 228 | mPrevYear->hide(); |
229 | mPrevMonth->hide(); | 229 | mPrevMonth->hide(); |
230 | } | 230 | } |
231 | 231 | ||
232 | if ( right ) { | 232 | if ( right ) { |
233 | mNextYear->show(); | 233 | mNextYear->show(); |
234 | mNextMonth->show(); | 234 | mNextMonth->show(); |
235 | } else { | 235 | } else { |
236 | mNextYear->hide(); | 236 | mNextYear->hide(); |
237 | mNextMonth->hide(); | 237 | mNextMonth->hide(); |
238 | } | 238 | } |
239 | if ( !left && !right ) { | 239 | if ( !left && !right ) { |
240 | //mSelectMonth->setMaximumWidth( 1024 ); | 240 | //mSelectMonth->setMaximumWidth( 1024 ); |
241 | mSelectMonth->setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); | 241 | mSelectMonth->setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | void NavigatorBar::selectMonth() | 245 | void NavigatorBar::selectMonth() |
246 | { | 246 | { |
247 | 247 | ||
248 | int month; | 248 | int month; |
249 | KPopupFrame* popup = new KPopupFrame(this); | 249 | KPopupFrame* popup = new KPopupFrame(this); |
250 | KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); | 250 | KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); |
251 | // ----- | 251 | // ----- |
252 | picker->resize(picker->sizeHint()); | 252 | picker->resize(picker->sizeHint()); |
253 | popup->setMainWidget(picker); | 253 | popup->setMainWidget(picker); |
254 | picker->setFocus(); | 254 | picker->setFocus(); |
255 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 255 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
256 | if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) | 256 | if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) |
257 | { | 257 | { |
258 | month = picker->getResult(); | 258 | month = picker->getResult(); |
259 | emit monthSelected ( month ); | 259 | emit monthSelected ( month ); |
260 | } else { | 260 | } else { |
261 | KNotifyClient::beep(); | 261 | KNotifyClient::beep(); |
262 | } | 262 | } |
263 | delete popup; | 263 | delete popup; |
264 | } | 264 | } |
265 | void NavigatorBar::selectDates( const KCal::DateList &dateList ) | 265 | void NavigatorBar::selectDates( const KCal::DateList &dateList ) |
266 | { | 266 | { |
267 | if (dateList.count() > 0) { | 267 | if (dateList.count() > 0) { |