bring back the toolbox reset after setIscontainment
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797081
This commit is contained in:
parent
f4e44f397e
commit
4e7e2cb345
@ -249,6 +249,7 @@ void Containment::containmentConstraintsUpdated(Plasma::Constraints constraints)
|
|||||||
|
|
||||||
if (constraints & Plasma::ScreenConstraint && d->toolbox) {
|
if (constraints & Plasma::ScreenConstraint && d->toolbox) {
|
||||||
if (d->type == PanelContainment) {
|
if (d->type == PanelContainment) {
|
||||||
|
//FIXME: geometry() always returns a 0x0 size in the panels
|
||||||
d->toolbox->setPos(geometry().width() - d->toolbox->boundingRect().width(), geometry().height()/2 - d->toolbox->size());
|
d->toolbox->setPos(geometry().width() - d->toolbox->boundingRect().width(), geometry().height()/2 - d->toolbox->size());
|
||||||
} else {
|
} else {
|
||||||
d->toolbox->setPos(geometry().width() - d->toolbox->boundingRect().width(), 0);
|
d->toolbox->setPos(geometry().width() - d->toolbox->boundingRect().width(), 0);
|
||||||
@ -298,7 +299,7 @@ void Containment::setContainmentType(Containment::Type type)
|
|||||||
QGraphicsWidget *activityTool = addToolBoxTool("addSiblingContainment", "list-add", i18n("Add Activity"));
|
QGraphicsWidget *activityTool = addToolBoxTool("addSiblingContainment", "list-add", i18n("Add Activity"));
|
||||||
connect(activityTool, SIGNAL(clicked()), this, SLOT(addSiblingContainment()));
|
connect(activityTool, SIGNAL(clicked()), this, SLOT(addSiblingContainment()));
|
||||||
}
|
}
|
||||||
//FIXME: the isContainment fix kinda got vanished in the woc migration
|
|
||||||
} else if (isContainment() && type == PanelContainment) {
|
} else if (isContainment() && type == PanelContainment) {
|
||||||
d->createToolbox();
|
d->createToolbox();
|
||||||
d->toolbox->setSize(24);
|
d->toolbox->setSize(24);
|
||||||
@ -309,6 +310,17 @@ void Containment::setContainmentType(Containment::Type type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Containment::setIsContainment(bool isContainment)
|
||||||
|
{
|
||||||
|
Applet::setIsContainment(isContainment);
|
||||||
|
|
||||||
|
// reset the toolbox!
|
||||||
|
delete d->toolbox;
|
||||||
|
d->toolbox = 0;
|
||||||
|
|
||||||
|
setContainmentType(d->type);
|
||||||
|
}
|
||||||
|
|
||||||
Corona* Containment::corona() const
|
Corona* Containment::corona() const
|
||||||
{
|
{
|
||||||
return dynamic_cast<Corona*>(scene());
|
return dynamic_cast<Corona*>(scene());
|
||||||
@ -781,16 +793,12 @@ void Containment::appletAnimationComplete(QGraphicsItem *item, Plasma::Phase::An
|
|||||||
{
|
{
|
||||||
if (anim == Phase::Disappear) {
|
if (anim == Phase::Disappear) {
|
||||||
QGraphicsItem *parent = item->parentItem();
|
QGraphicsItem *parent = item->parentItem();
|
||||||
QGraphicsLayout *lay = layout();
|
|
||||||
QGraphicsLinearLayout * linearLay = dynamic_cast<QGraphicsLinearLayout *>(lay);
|
|
||||||
while (parent) {
|
while (parent) {
|
||||||
if (parent == this) {
|
if (parent == this) {
|
||||||
Applet *applet = qgraphicsitem_cast<Applet*>(item);
|
Applet *applet = qgraphicsitem_cast<Applet*>(item);
|
||||||
|
|
||||||
if (applet) {
|
if (applet) {
|
||||||
if (linearLay) {
|
|
||||||
linearLay->removeItem(applet);
|
|
||||||
}
|
|
||||||
applet->destroy();
|
applet->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +143,11 @@ class PLASMA_EXPORT Containment : public Applet
|
|||||||
*/
|
*/
|
||||||
void setContainmentType(Containment::Type type);
|
void setContainmentType(Containment::Type type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from Applet
|
||||||
|
*/
|
||||||
|
void setIsContainment(bool isContainment);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Corona (if any) that this Containment is hosted by
|
* Returns the Corona (if any) that this Containment is hosted by
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user