move the extra border in the size hint

svn path=/trunk/KDE/kdelibs/; revision=1041792
This commit is contained in:
Marco Martin 2009-10-28 14:19:34 +00:00
parent d53654784a
commit dd581265cf
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ public:
bool canScroll(Direction direction, bool hasOvershoot = false) const bool canScroll(Direction direction, bool hasOvershoot = false) const
{ {
QPointF scrollPosition = -parent->property("scrollPosition").value<QPointF>(); QPointF scrollPosition = -parent->property("scrollPosition").value<QPointF>();
int offset = (hasOvershoot?overshoot*2:-4); int offset = (hasOvershoot?overshoot*2:0);
switch (direction) { switch (direction) {
case Up: case Up:
@ -203,7 +203,7 @@ void KineticScrolling::wheelReleaseEvent(QGraphicsSceneWheelEvent *event)
mousePressEvent(0); mousePressEvent(0);
duration(); duration();
int temp = -event->delta(); int temp = -event->delta()/2;
if ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Down)) || if ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Down)) ||
(event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Up))){ (event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Up))){

View File

@ -480,7 +480,7 @@ QSizeF ScrollWidget::sizeHint(Qt::SizeHint which, const QSizeF & constraint) con
QSizeF hint = QGraphicsWidget::sizeHint(which, constraint); QSizeF hint = QGraphicsWidget::sizeHint(which, constraint);
if (which == Qt::PreferredSize && d->widget) { if (which == Qt::PreferredSize && d->widget) {
return d->widget->size().expandedTo(d->widget->effectiveSizeHint(Qt::PreferredSize)); return (d->widget->size()+QSize(4,4)).expandedTo(d->widget->effectiveSizeHint(Qt::PreferredSize));
} }
return hint; return hint;