decide based on the sizehint whether resize the internal widget or not
svn path=/trunk/KDE/kdelibs/; revision=1038632
This commit is contained in:
parent
cdfbfc2a8f
commit
9f806ddf48
@ -148,7 +148,14 @@ public:
|
||||
rightBorder->setPos(q->size().width() - rightBorder->size().width(), 0);
|
||||
}
|
||||
|
||||
widget->resize(scrollingWidget->size().width(), widget->size().height());
|
||||
QSizeF widgetSize = widget->size();
|
||||
if (widget->sizePolicy().expandingDirections() & Qt::Horizontal) {
|
||||
widgetSize.setWidth(scrollingWidget->size().width());
|
||||
}
|
||||
if (widget->sizePolicy().expandingDirections() & Qt::Vertical) {
|
||||
widgetSize.setHeight(scrollingWidget->size().height());
|
||||
}
|
||||
widget->resize(widgetSize);
|
||||
}
|
||||
|
||||
void verticalScroll(int value)
|
||||
@ -275,6 +282,7 @@ void ScrollWidget::setWidget(QGraphicsWidget *widget)
|
||||
|
||||
d->widget = widget;
|
||||
Plasma::Animator::self()->registerScrollingManager(this);
|
||||
//it's not good it's setting a size policy here, but it's done to be retrocompatible with older applications
|
||||
widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
widget->setParentItem(d->scrollingWidget);
|
||||
widget->setPos(QPoint(0,0));
|
||||
|
@ -63,7 +63,11 @@ public:
|
||||
/**
|
||||
* Sets the widget this ScrollWidget will contain
|
||||
* ownership is transferred to this scrollwidget,
|
||||
* if an old one was already in, it will be deleted
|
||||
* if an old one was already in, it will be deleted.
|
||||
* If the widget size policy will have an horizontal expand direction,
|
||||
* it will be resized when possible, otherwise it will be keps to whichever
|
||||
* width the widget resizes itself.
|
||||
* The same thing it's true for the vertical size hint.
|
||||
*
|
||||
* @arg widget the new main sub widget
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user