-rw-r--r-- | kaddressbook/views/cardview.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp index 84d3116..b6e053f 100644 --- a/kaddressbook/views/cardview.cpp +++ b/kaddressbook/views/cardview.cpp | |||
@@ -927,42 +927,41 @@ CardViewItem *CardView::findItem(const QString &text, const QString &label, | |||
927 | */ | 927 | */ |
928 | 928 | ||
929 | uint CardView::columnWidth() | 929 | uint CardView::columnWidth() |
930 | { | 930 | { |
931 | return d->mDrawSeparators ? | 931 | return d->mDrawSeparators ? |
932 | d->mItemWidth + ( 2 * d->mItemSpacing ) + d->mSepWidth : | 932 | d->mItemWidth + ( 2 * d->mItemSpacing ) + d->mSepWidth : |
933 | d->mItemWidth + d->mItemSpacing; | 933 | d->mItemWidth + d->mItemSpacing; |
934 | } | 934 | } |
935 | 935 | ||
936 | void CardView::drawContents(QPainter *p, int clipx, int clipy, | 936 | void CardView::drawContents(QPainter *p, int clipx, int clipy, |
937 | int clipw, int cliph) | 937 | int clipw, int cliph) |
938 | { | 938 | { |
939 | QScrollView::drawContents(p, clipx, clipy, clipw, cliph); | 939 | //QScrollView::drawContents(p, clipx, clipy, clipw, cliph); |
940 | |||
941 | if (d->mLayoutDirty) | 940 | if (d->mLayoutDirty) |
942 | calcLayout(); | 941 | calcLayout(); |
943 | 942 | ||
944 | //kdDebug() << "CardView::drawContents: " << clipx << ", " << clipy | 943 | //kdDebug() << "CardView::drawContents: " << clipx << ", " << clipy |
945 | // << ", " << clipw << ", " << cliph << endl; | 944 | // << ", " << clipw << ", " << cliph << endl; |
946 | 945 | ||
947 | QColorGroup cg = viewport()->palette().active(); // allow setting costum colors in the viewport pale | 946 | QColorGroup cg = viewport()->palette().active(); // allow setting costum colors in the viewport pale |
948 | 947 | int cX, cY; | |
948 | contentsToViewport ( clipx, clipy, cX, cY ); | ||
949 | QRect clipRect(clipx, clipy, clipw, cliph); | 949 | QRect clipRect(clipx, clipy, clipw, cliph); |
950 | QRect cardRect; | 950 | QRect cardRect; |
951 | QRect sepRect; | 951 | QRect sepRect; |
952 | CardViewItem *item; | 952 | CardViewItem *item; |
953 | CardViewSeparator *sep; | 953 | CardViewSeparator *sep; |
954 | |||
955 | // make sure the viewport is a pure background | 954 | // make sure the viewport is a pure background |
956 | viewport()->erase(clipRect); | 955 | viewport()->erase( QRect ( cX, cY , clipw, cliph ) ); |
957 | 956 | ||
958 | // Now tell the cards to draw, if they are in the clip region | 957 | // Now tell the cards to draw, if they are in the clip region |
959 | QPtrListIterator<CardViewItem> iter(d->mItemList); | 958 | QPtrListIterator<CardViewItem> iter(d->mItemList); |
960 | for (iter.toFirst(); iter.current(); ++iter) | 959 | for (iter.toFirst(); iter.current(); ++iter) |
961 | { | 960 | { |
962 | item = *iter; | 961 | item = *iter; |
963 | cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() ); | 962 | cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() ); |
964 | 963 | ||
965 | if (clipRect.intersects(cardRect) || clipRect.contains(cardRect)) | 964 | if (clipRect.intersects(cardRect) || clipRect.contains(cardRect)) |
966 | { | 965 | { |
967 | //kdDebug() << "\trepainting card at: " << cardRect.x() << ", " | 966 | //kdDebug() << "\trepainting card at: " << cardRect.x() << ", " |
968 | // << cardRect.y() << endl; | 967 | // << cardRect.y() << endl; |