author | zautrix <zautrix> | 2005-03-25 02:15:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 02:15:46 (UTC) |
commit | 658354b7112aff72f0fadd924c82b977d803bc27 (patch) (unidiff) | |
tree | da728354015340c16466fbfb3c851d96d6d95196 | |
parent | 7c2e130ddd194f1c4b5365af6999a27c08232f4b (diff) | |
download | kdepimpi-658354b7112aff72f0fadd924c82b977d803bc27.zip kdepimpi-658354b7112aff72f0fadd924c82b977d803bc27.tar.gz kdepimpi-658354b7112aff72f0fadd924c82b977d803bc27.tar.bz2 |
fixes
-rw-r--r-- | korganizer/komonthview.cpp | 88 |
1 files changed, 55 insertions, 33 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 8ee5bc3..050bfb9 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -314,5 +314,6 @@ int MonthViewItem::height(const QListBox *lb) const | |||
314 | { | 314 | { |
315 | int ret = 10; | ||
315 | if ( lb ) | 316 | if ( lb ) |
316 | return lb->fontMetrics().lineSpacing()+1; | 317 | ret = lb->fontMetrics().lineSpacing()+1; |
317 | return 10; | 318 | return ret; |
318 | } | 319 | } |
@@ -321,25 +322,31 @@ int MonthViewItem::width(const QListBox *lb) const | |||
321 | { | 322 | { |
322 | int size = PIXMAP_SIZE; | 323 | |
323 | if ( QApplication::desktop()->width() < 300 ) | 324 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { |
324 | size = 3; | 325 | int size = PIXMAP_SIZE; |
325 | int x = 1; | 326 | if ( QApplication::desktop()->width() < 300 ) |
326 | if ( KOPrefs::instance()->mMonthShowIcons ) { | 327 | size = 3; |
327 | if ( mInfo ) { | 328 | int x = 1; |
328 | x += size + 1; | 329 | if ( KOPrefs::instance()->mMonthShowIcons ) { |
329 | } | 330 | if ( mInfo ) { |
330 | if( mRecur ) { | 331 | x += size + 1; |
331 | x += size+1; | 332 | } |
332 | } | 333 | if( mRecur ) { |
333 | if( mAlarm ) { | 334 | x += size+1; |
334 | x += size+1; | 335 | } |
336 | if( mAlarm ) { | ||
337 | x += size+1; | ||
338 | } | ||
339 | if( mReply ) { | ||
340 | x += size+1; | ||
341 | } | ||
335 | } | 342 | } |
336 | if( mReply ) { | 343 | if( mMultiday ) { |
337 | x += size+1; | 344 | x += size+1+2+size/2; |
338 | } | 345 | } |
346 | return( x + lb->fontMetrics().width( text() ) + 1 ); | ||
339 | } | 347 | } |
340 | if( mMultiday ) { | 348 | if ( ! lb ) |
341 | x += size+1+2+size/2; | 349 | return 10; |
342 | } | 350 | //qDebug("ret wid %d ", lb->width()); |
343 | 351 | return lb->width(); | |
344 | return( x + lb->fontMetrics().width( text() ) + 1 ); | ||
345 | } | 352 | } |
@@ -352,3 +359,3 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | |||
352 | 359 | ||
353 | QVBoxLayout *topLayout = new QVBoxLayout( this ); | 360 | //QVBoxLayout *topLayout = new QVBoxLayout( this ); |
354 | 361 | ||
@@ -365,3 +372,3 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | |||
365 | mItemList->setLineWidth( 1 ); | 372 | mItemList->setLineWidth( 1 ); |
366 | topLayout->addWidget( mItemList ); | 373 | //topLayout->addWidget( mItemList ); |
367 | mLabel->raise(); | 374 | mLabel->raise(); |
@@ -419,13 +426,16 @@ void MonthViewCell::setMyPalette() | |||
419 | if ( mHoliday) { | 426 | if ( mHoliday) { |
420 | setPalette( mHolidayPalette ); | 427 | mLabel->setPalette( QPalette ( mHolidayPalette.color( QPalette::Normal,QColorGroup::Base),mHolidayPalette.color(QPalette::Normal,QColorGroup::Base ) )); |
428 | mItemList->setPalette( mHolidayPalette ); | ||
421 | } else { | 429 | } else { |
422 | if ( mPrimary ) { | 430 | if ( mPrimary ) { |
423 | setPalette( mPrimaryPalette ); | 431 | mLabel->setPalette( QPalette ( mPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); |
432 | mItemList->setPalette( mPrimaryPalette ); | ||
424 | } else { | 433 | } else { |
425 | setPalette( mNonPrimaryPalette ); | 434 | mItemList->setPalette( mNonPrimaryPalette ); |
435 | mLabel->setPalette( QPalette ( mNonPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mNonPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); | ||
426 | } | 436 | } |
427 | } | 437 | } |
428 | QPalette pal = palette(); | 438 | //QPalette pal = palette(); |
429 | 439 | ||
430 | mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) )); | 440 | //mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) )); |
431 | } | 441 | } |
@@ -676,3 +686,4 @@ void MonthViewCell::finishUpdateCell() | |||
676 | mLabel->setText( text ); | 686 | mLabel->setText( text ); |
677 | resizeEvent( 0 ); | 687 | resizeEvent( 0 ); |
688 | |||
678 | } | 689 | } |
@@ -737,4 +748,12 @@ void MonthViewCell::enableScrollBars( bool enabled ) | |||
737 | if ( enabled ) { | 748 | if ( enabled ) { |
738 | mItemList->setVScrollBarMode(QScrollView::Auto); | 749 | //mItemList->setVScrollBarMode(QScrollView::Auto); |
739 | mItemList->setHScrollBarMode(QScrollView::Auto); | 750 | mItemList->setHScrollBarMode(QScrollView::Auto); |
751 | QListBoxItem *fi = mItemList->firstItem (); | ||
752 | if (fi ) { | ||
753 | int hei = mItemList->numRows () * fi->height(mItemList); | ||
754 | if ( hei < height() - mItemList->horizontalScrollBar()->height () ) | ||
755 | mItemList->setVScrollBarMode(QScrollView::AlwaysOff); | ||
756 | else | ||
757 | mItemList->setVScrollBarMode(QScrollView::Auto); | ||
758 | } | ||
740 | } else { | 759 | } else { |
@@ -783,3 +802,3 @@ void MonthViewCell::select() | |||
783 | 802 | ||
784 | void MonthViewCell::resizeEvent ( QResizeEvent * ) | 803 | void MonthViewCell::resizeEvent ( QResizeEvent * e ) |
785 | { | 804 | { |
@@ -787,3 +806,4 @@ void MonthViewCell::resizeEvent ( QResizeEvent * ) | |||
787 | return; | 806 | return; |
788 | 807 | //qDebug("++++++++++++++MonthViewCell::resizeEvent %d %d ", width(), height()); | |
808 | deselect(); | ||
789 | int size = height() - mLabel->height() - 2; | 809 | int size = height() - mLabel->height() - 2; |
@@ -796,2 +816,4 @@ void MonthViewCell::resizeEvent ( QResizeEvent * ) | |||
796 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 816 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
817 | mItemList->resize ( width(), height () ); | ||
818 | |||
797 | } | 819 | } |