Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/declarative/qmlscreen.cpp
Context not available. | |||||
186 | 186 | | |||
---|---|---|---|---|---|
187 | float QMLScreen::outputScale() const | 187 | float QMLScreen::outputScale() const | ||
188 | { | 188 | { | ||
189 | return 1.0 / 8.0; | 189 | return 1.0 / 12.0; | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | void QMLScreen::outputConnectedChanged() | 192 | void QMLScreen::outputConnectedChanged() | ||
Context not available. | |||||
317 | 317 | | |||
318 | void QMLScreen::updateOutputsPlacement() | 318 | void QMLScreen::updateOutputsPlacement() | ||
319 | { | 319 | { | ||
320 | int disabledOffsetX = width(); | | |||
321 | QSizeF activeScreenSize; | 320 | QSizeF activeScreenSize; | ||
322 | 321 | | |||
323 | Q_FOREACH (QQuickItem *item, childItems()) { | 322 | Q_FOREACH (QQuickItem *item, childItems()) { | ||
324 | QMLOutput *qmlOutput = qobject_cast<QMLOutput*>(item); | 323 | QMLOutput *qmlOutput = qobject_cast<QMLOutput*>(item); | ||
325 | if (!qmlOutput->output()->isConnected()) { | 324 | if (!qmlOutput->output()->isConnected() || !qmlOutput->output()->isEnabled()) { | ||
326 | continue; | | |||
327 | } | | |||
328 | | ||||
329 | if (!qmlOutput->output()->isEnabled()) { | | |||
330 | qmlOutput->blockSignals(true); | | |||
331 | disabledOffsetX -= qmlOutput->width(); | | |||
332 | qmlOutput->setPosition(QPoint(disabledOffsetX, 0)); | | |||
333 | qmlOutput->blockSignals(false); | | |||
334 | continue; | 325 | continue; | ||
335 | } | 326 | } | ||
336 | 327 | | |||
Context not available. | |||||
347 | const QPointF offset((width() - activeScreenSize.width()) / 2.0, | 338 | const QPointF offset((width() - activeScreenSize.width()) / 2.0, | ||
348 | (height() - activeScreenSize.height()) / 2.0); | 339 | (height() - activeScreenSize.height()) / 2.0); | ||
349 | 340 | | |||
341 | qreal lastX = -1.0; | ||||
342 | qreal lastY = -1.0; | ||||
350 | Q_FOREACH (QQuickItem *item, childItems()) { | 343 | Q_FOREACH (QQuickItem *item, childItems()) { | ||
351 | QMLOutput *qmlOutput = qobject_cast<QMLOutput*>(item); | 344 | QMLOutput *qmlOutput = qobject_cast<QMLOutput*>(item); | ||
352 | if (!qmlOutput->output()->isConnected() || !qmlOutput->output()->isEnabled()) { | 345 | if (!qmlOutput->output()->isConnected() || !qmlOutput->output()->isEnabled()) { | ||
Context not available. | |||||
356 | qmlOutput->blockSignals(true); | 349 | qmlOutput->blockSignals(true); | ||
357 | qmlOutput->setPosition(QPointF(offset.x() + (qmlOutput->outputX() * outputScale()), | 350 | qmlOutput->setPosition(QPointF(offset.x() + (qmlOutput->outputX() * outputScale()), | ||
358 | offset.y() + (qmlOutput->outputY() * outputScale()))); | 351 | offset.y() + (qmlOutput->outputY() * outputScale()))); | ||
352 | lastX = qMax(lastX, qmlOutput->position().x() + qmlOutput->width()); | ||||
353 | lastY = qMax(lastY, qmlOutput->position().y()); | ||||
359 | qmlOutput->blockSignals(false); | 354 | qmlOutput->blockSignals(false); | ||
360 | } | 355 | } | ||
356 | | ||||
357 | Q_FOREACH (QQuickItem *item, childItems()) { | ||||
358 | QMLOutput *qmlOutput = qobject_cast<QMLOutput*>(item); | ||||
359 | if (qmlOutput->output()->isConnected() && !qmlOutput->output()->isEnabled()) { | ||||
360 | qmlOutput->blockSignals(true); | ||||
361 | qmlOutput->setPosition(QPointF(lastX, lastY)); | ||||
362 | lastX += qmlOutput->width(); | ||||
363 | qmlOutput->blockSignals(false); | ||||
364 | } | ||||
365 | } | ||||
361 | } | 366 | } | ||
362 | 367 | | |||
363 | void QMLScreen::setEngine(QQmlEngine* engine) | 368 | void QMLScreen::setEngine(QQmlEngine* engine) | ||
Context not available. |