set panels properly in setScreen. this will need to be augmented with screen edge stuff eventually as well, but for now this might work better on multiple screens.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=729421
This commit is contained in:
Aaron J. Seigo 2007-10-25 23:09:02 +00:00
parent 136363aefe
commit 576798dd52
3 changed files with 19 additions and 16 deletions

View File

@ -120,16 +120,6 @@ void Containment::init()
}
}
if (type() == PanelContainment) {
//kDebug() << "we are a panel, let's move ourselves to a negative coordinate system";
QDesktopWidget desktop;
QRect r = desktop.screenGeometry(screen());
//FIXME PANELS: multiple panel support means having to move the panels up
// this requires a proper panel manager, discuss in the panel
// irc meeting
translate(0, -r.height() - INTER_CONTAINMENT_MARGIN);
}
//TODO: would be nice to not do this on init, as it causes Phase to init
connect(Phase::self(), SIGNAL(animationComplete(QGraphicsItem*,Plasma::Phase::Animation)),
this, SLOT(appletDisappearComplete(QGraphicsItem*,Plasma::Phase::Animation)));
@ -472,6 +462,8 @@ Applet::List Containment::applets() const
void Containment::setScreen(int screen)
{
// screen of -1 means no associated screen.
//kDebug() << "setting screen to" << screen;
QDesktopWidget desktop;
int numScreens = desktop.numScreens();
@ -480,9 +472,19 @@ void Containment::setScreen(int screen)
}
//kDebug() << "setting scrreen to " << screen << "and type is" << type();
if (screen > -1 && type() == DesktopContainment) {
setGeometry(desktop.screenGeometry(screen));
//kDebug() << "setting geometry to" << desktop.screenGeometry(screen) << geometry();
if (screen > -1) {
if (type() == DesktopContainment) {
setGeometry(desktop.screenGeometry(screen));
//kDebug() << "setting geometry to" << desktop.screenGeometry(screen) << geometry();
} else if (type() == PanelContainment) {
//kDebug() << "we are a panel, let's move ourselves to a negative coordinate system";
QDesktopWidget desktop;
QRect r = desktop.screenGeometry(screen);
//FIXME PANELS: multiple panel support means having to move the panels up
// this requires a proper panel manager, discuss in the panel
// irc meeting
translate(0, -r.height() - INTER_CONTAINMENT_MARGIN);
}
}
d->screen = screen;

View File

@ -221,6 +221,7 @@ void Corona::loadDefaultSetup()
// make a panel at the bottom
Containment* panel = addContainment("panel", (QVariantList() << (int)Plasma::BottomEdge));
panel->setScreen(0);
// some default applets to get a usable UI
panel->addApplet("launcher");

View File

@ -378,7 +378,7 @@ void Widget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QW
// Auto-adjust the pixmap size.
if (deviceRect.size() != pix.size()) {
pix = QPixmap(deviceRect.size());
pix.fill(Qt::transparent);
pix.fill(Qt::transparent);
exposed = brect;
}
@ -441,10 +441,10 @@ void Widget::managingLayoutChanged()
if (managingLayout()) {
d->wasMovable = flags() & ItemIsMovable;
if (!dynamic_cast<FreeLayout*>(managingLayout())) {
// setFlag(ItemIsMovable, false);
setFlag(ItemIsMovable, false);
}
} else {
// setFlag(ItemIsMovable, d->wasMovable);
setFlag(ItemIsMovable, d->wasMovable);
}
}