grant minimal access to the toolbox so we can avoid nasty hacks in containments. see next commit to PanelContainment for what i meant ;)
svn path=/trunk/KDE/kdelibs/; revision=886223
This commit is contained in:
parent
c027fb3886
commit
8a68d06f0d
@ -1024,6 +1024,11 @@ void Containment::dropEvent(QGraphicsSceneDragDropEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
const QGraphicsItem *Containment::toolBoxItem() const
|
||||
{
|
||||
return d->toolBox;
|
||||
}
|
||||
|
||||
void Containment::resizeEvent(QGraphicsSceneResizeEvent *event)
|
||||
{
|
||||
Applet::resizeEvent(event);
|
||||
@ -1529,7 +1534,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
||||
return;
|
||||
}
|
||||
|
||||
//kDebug() << "got containmentConstraintsEvent" << constraints << (QObject*)toolBox;
|
||||
kDebug() << "got containmentConstraintsEvent" << constraints << (QObject*)toolBox;
|
||||
if (constraints & Plasma::ImmutableConstraint) {
|
||||
//update actions
|
||||
bool unlocked = q->immutability() == Mutable;
|
||||
@ -1558,11 +1563,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
||||
}
|
||||
|
||||
if (q->isContainment() && type == Containment::PanelContainment) {
|
||||
if (unlocked) {
|
||||
toolBox->show();
|
||||
} else {
|
||||
toolBox->hide();
|
||||
}
|
||||
toolBox->setVisible(unlocked);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1590,7 +1591,6 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
||||
positionPanel();
|
||||
break;
|
||||
default:
|
||||
positionContainment();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1599,6 +1599,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
||||
constraints & Plasma::FormFactorConstraint ||
|
||||
constraints & Plasma::ScreenConstraint ||
|
||||
constraints & Plasma::StartupCompletedConstraint)) {
|
||||
kDebug() << "BWUHA!";
|
||||
positionToolBox();
|
||||
}
|
||||
}
|
||||
|
@ -494,6 +494,11 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
*/
|
||||
void resizeEvent(QGraphicsSceneResizeEvent *event);
|
||||
|
||||
/**
|
||||
* @returns the toolbox associated with this containment, or a null pointer if none
|
||||
*/
|
||||
const QGraphicsItem *toolBoxItem() const;
|
||||
|
||||
private:
|
||||
Q_PRIVATE_SLOT(d, void appletDestroyed(QObject*))
|
||||
Q_PRIVATE_SLOT(d, void containmentAppletAnimationComplete(QGraphicsItem *item,
|
||||
|
Loading…
Reference in New Issue
Block a user