welcome back to the background that will be a little modified soon with window frame (that
will include the applet handle No More Seperate Item ;) ) + delete in layouts in containments when removing applets svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797066
This commit is contained in:
parent
b8e3eed0dc
commit
d5753f1fba
14
applet.cpp
14
applet.cpp
@ -725,12 +725,14 @@ void Applet::setDrawStandardBackground(bool drawBackground)
|
||||
if (drawBackground) {
|
||||
if (!d->background) {
|
||||
d->background = new Plasma::SvgPanel("widgets/background");
|
||||
d->background->setBorderFlags(Plasma::SvgPanel::DrawAllBorders);
|
||||
int left, top, right, bottom;
|
||||
d->getBorderSize(left, top, right, bottom);
|
||||
setContentsMargins(0, 0, right, bottom);
|
||||
d->background->resize(QSize(geometry().width() + right + left, geometry().height() + top + bottom));
|
||||
d->background->setPos(QPointF(-left, -top));
|
||||
//kDebug() << geometry() << left << top << right << bottom;
|
||||
QSizeF fitSize(left + right, top + bottom);
|
||||
if (minimumSize().expandedTo(fitSize) != minimumSize()) {
|
||||
setMinimumSize(minimumSize().expandedTo(fitSize));
|
||||
}
|
||||
d->background->resize(boundingRect().size());
|
||||
}
|
||||
} else if (d->background) {
|
||||
delete d->background;
|
||||
@ -1511,6 +1513,10 @@ void Applet::setGeometry(const QRectF& geometry)
|
||||
}
|
||||
if (geometry.topLeft() != beforeGeom.topLeft())
|
||||
{
|
||||
if (d->background) {
|
||||
|
||||
kDebug() << QGraphicsWidget::geometry();
|
||||
}
|
||||
emit geometryChanged();
|
||||
}
|
||||
}
|
||||
|
@ -278,10 +278,16 @@ void AppletBrowserWidget::destroyApplets(const QString &name)
|
||||
|
||||
foreach (Containment *containment, c->containments()) {
|
||||
QList<Applet*> applets = containment->applets();
|
||||
QGraphicsLayout *lay = containment->layout();
|
||||
QGraphicsLinearLayout * linearLay = dynamic_cast<QGraphicsLinearLayout *>(lay);
|
||||
foreach (Applet *applet,applets) {
|
||||
d->appletNames.remove(applet);
|
||||
if (applet->name() == name) {
|
||||
applet->disconnect(this);
|
||||
if (linearLay)
|
||||
{
|
||||
linearLay->removeItem(applet);
|
||||
}
|
||||
applet->destroy();
|
||||
}
|
||||
}
|
||||
|
@ -776,12 +776,16 @@ void Containment::appletAnimationComplete(QGraphicsItem *item, Plasma::Phase::An
|
||||
{
|
||||
if (anim == Phase::Disappear) {
|
||||
QGraphicsItem *parent = item->parentItem();
|
||||
|
||||
QGraphicsLayout *lay = layout();
|
||||
QGraphicsLinearLayout * linearLay = dynamic_cast<QGraphicsLinearLayout *>(lay);
|
||||
while (parent) {
|
||||
if (parent == this) {
|
||||
Applet *applet = qgraphicsitem_cast<Applet*>(item);
|
||||
|
||||
if (applet) {
|
||||
if (linearLay) {
|
||||
linearLay->removeItem(applet);
|
||||
}
|
||||
applet->destroy();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user