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)
|
void Containment::resizeEvent(QGraphicsSceneResizeEvent *event)
|
||||||
{
|
{
|
||||||
Applet::resizeEvent(event);
|
Applet::resizeEvent(event);
|
||||||
@ -1529,7 +1534,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//kDebug() << "got containmentConstraintsEvent" << constraints << (QObject*)toolBox;
|
kDebug() << "got containmentConstraintsEvent" << constraints << (QObject*)toolBox;
|
||||||
if (constraints & Plasma::ImmutableConstraint) {
|
if (constraints & Plasma::ImmutableConstraint) {
|
||||||
//update actions
|
//update actions
|
||||||
bool unlocked = q->immutability() == Mutable;
|
bool unlocked = q->immutability() == Mutable;
|
||||||
@ -1558,11 +1563,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (q->isContainment() && type == Containment::PanelContainment) {
|
if (q->isContainment() && type == Containment::PanelContainment) {
|
||||||
if (unlocked) {
|
toolBox->setVisible(unlocked);
|
||||||
toolBox->show();
|
|
||||||
} else {
|
|
||||||
toolBox->hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1590,7 +1591,6 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
|||||||
positionPanel();
|
positionPanel();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
positionContainment();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1599,6 +1599,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
|||||||
constraints & Plasma::FormFactorConstraint ||
|
constraints & Plasma::FormFactorConstraint ||
|
||||||
constraints & Plasma::ScreenConstraint ||
|
constraints & Plasma::ScreenConstraint ||
|
||||||
constraints & Plasma::StartupCompletedConstraint)) {
|
constraints & Plasma::StartupCompletedConstraint)) {
|
||||||
|
kDebug() << "BWUHA!";
|
||||||
positionToolBox();
|
positionToolBox();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -494,6 +494,11 @@ class PLASMA_EXPORT Containment : public Applet
|
|||||||
*/
|
*/
|
||||||
void resizeEvent(QGraphicsSceneResizeEvent *event);
|
void resizeEvent(QGraphicsSceneResizeEvent *event);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns the toolbox associated with this containment, or a null pointer if none
|
||||||
|
*/
|
||||||
|
const QGraphicsItem *toolBoxItem() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_PRIVATE_SLOT(d, void appletDestroyed(QObject*))
|
Q_PRIVATE_SLOT(d, void appletDestroyed(QObject*))
|
||||||
Q_PRIVATE_SLOT(d, void containmentAppletAnimationComplete(QGraphicsItem *item,
|
Q_PRIVATE_SLOT(d, void containmentAppletAnimationComplete(QGraphicsItem *item,
|
||||||
|
Loading…
Reference in New Issue
Block a user