z value related cleanups, including one fixme

svn path=/trunk/KDE/kdelibs/; revision=897861
This commit is contained in:
Aaron J. Seigo 2008-12-17 00:51:30 +00:00
parent c26e118bbf
commit 97869ca7c7
4 changed files with 12 additions and 5 deletions

View File

@ -459,8 +459,8 @@ void AppletPrivate::createMessageOverlay()
zValue = child->zValue() + 1;
}
}
messageOverlay->setZValue(zValue);
messageOverlay->setZValue(zValue);
}
void AppletPrivate::destroyMessageOverlay()
@ -815,8 +815,14 @@ void Applet::setConfigurationRequired(bool needsConfig, const QString &reason)
configWidget->setDrawBackground(true);
connect(configWidget, SIGNAL(clicked()), this, SLOT(showConfigurationInterface()));
configLayout->addItem(configWidget, row, 1);
//FIXME: this thing seems necessary for some applets, others not
configWidget->setZValue(999);
// raise the overlay above all the other children!
int zValue = 100;
foreach (QGraphicsItem *child, QGraphicsItem::children()) {
if (child->zValue() > zValue) {
zValue = child->zValue() + 1;
}
}
configWidget->setZValue(zValue);
} else {
PushButton *configWidget = new PushButton(d->messageOverlay);
configWidget->setText(i18n("Configure..."));

View File

@ -125,7 +125,7 @@ AppletHandle::AppletHandle(Containment *parent, Applet *applet, const QPointF &h
//so we want a high zValue.
//FIXME: apparently this doesn't work: sometimes an applet still get's drawn behind
//the containment it's being dragged to, sometimes it doesn't.
m_zValue = m_applet->zValue()-1;
m_zValue = m_applet->zValue() - 1;
m_applet->raise();
m_applet->installSceneEventFilter(this);
setZValue(m_applet->zValue());

View File

@ -456,6 +456,7 @@ void DesktopToolBox::showToolBox()
if (!d->toolBacker) {
d->toolBacker = new EmptyGraphicsItem(this);
d->toolBacker->setZValue(zValue() + 1);
}
d->toolBacker->setIsToolbar(isToolbar());

View File

@ -120,7 +120,7 @@ void ToolBox::addTool(QAction *action)
tool->hide();
const int height = static_cast<int>(tool->boundingRect().height());
tool->setPos(toolPosition(height));
tool->setZValue(zValue() + 1);
tool->setZValue(zValue() + 10);
tool->setToolTip(action->text());
//make enabled/disabled tools appear/disappear instantly