Simplify assigning panels to screens
This commit is contained in:
parent
be021453a2
commit
e5ef979ba1
@ -330,11 +330,8 @@ void ShellCorona::createWaitingPanels()
|
|||||||
foreach (Plasma::Containment *cont, d->waitingPanels) {
|
foreach (Plasma::Containment *cont, d->waitingPanels) {
|
||||||
d->panelViews[cont] = new PanelView(this);
|
d->panelViews[cont] = new PanelView(this);
|
||||||
|
|
||||||
|
|
||||||
//keep screen suggestions within bounds of screens we actually have
|
//keep screen suggestions within bounds of screens we actually have
|
||||||
int screen = cont->lastScreen();
|
int screen = qBound(0, cont->lastScreen(), QGuiApplication::screens().size() -1);
|
||||||
screen = qMax(screen, 0);
|
|
||||||
screen = qMin(screen, QGuiApplication::screens().size() -1);
|
|
||||||
|
|
||||||
d->panelViews[cont]->setScreen(QGuiApplication::screens()[screen]);
|
d->panelViews[cont]->setScreen(QGuiApplication::screens()[screen]);
|
||||||
d->panelViews[cont]->setContainment(cont);
|
d->panelViews[cont]->setContainment(cont);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user