panelview.cpp | panelview.cpp | |||
---|---|---|---|---|
skipping to change at line 1363 | skipping to change at line 1363 | |||
return QPointF(qBound(containmentRect.left() + m_leftPadding, point.x() , containmentRect.right() - m_rightPadding - 1), | return QPointF(qBound(containmentRect.left() + m_leftPadding, point.x() , containmentRect.right() - m_rightPadding - 1), | |||
qBound(containmentRect.top() + m_topPadding, point.y(), containmentRect.bottom() - m_bottomPadding - 1)); | qBound(containmentRect.top() + m_topPadding, point.y(), containmentRect.bottom() - m_bottomPadding - 1)); | |||
} | } | |||
void PanelView::updateMask() | void PanelView::updateMask() | |||
{ | { | |||
if (!containment()) { | if (!containment()) { | |||
return; | return; | |||
} | } | |||
// Popups now align to the mask, without it they appear in the wrong po | ||||
sition | ||||
// always create it and show blur and contrast when needed | ||||
QRegion mask; | ||||
QQuickItem *rootObject = this->rootObject(); | ||||
QRect screenPanelRect = geometry(); | ||||
screenPanelRect.moveTo(mapFromGlobal(screenPanelRect.topLeft())); | ||||
if (rootObject) { | ||||
QVariant maskProperty = rootObject->property("panelMask"); | ||||
if (static_cast<QMetaType::Type>(maskProperty.typeId()) == QMetaTyp | ||||
e::QRegion) { | ||||
mask = get<QRegion>(std::move(maskProperty)); | ||||
const QPoint floatingTranslucentItemOffset = rootObject->proper | ||||
ty("floatingTranslucentItemOffset").toPoint(); | ||||
mask.translate(floatingTranslucentItemOffset); | ||||
} | ||||
} | ||||
if (mask.isEmpty()) { | ||||
mask = QRegion(QRect(screenPanelRect)); | ||||
} | ||||
if (m_backgroundHints == Plasma::Types::NoBackground) { | if (m_backgroundHints == Plasma::Types::NoBackground) { | |||
KWindowEffects::enableBlurBehind(this, false); | KWindowEffects::enableBlurBehind(this, false); | |||
KWindowEffects::enableBackgroundContrast(this, false); | KWindowEffects::enableBackgroundContrast(this, false); | |||
setMask(QRegion()); | ||||
} else { | } else { | |||
QRegion mask; | ||||
QQuickItem *rootObject = this->rootObject(); | ||||
QRect screenPanelRect = geometry(); | ||||
screenPanelRect.moveTo(mapFromGlobal(screenPanelRect.topLeft())); | ||||
if (rootObject) { | ||||
QVariant maskProperty = rootObject->property("panelMask"); | ||||
if (static_cast<QMetaType::Type>(maskProperty.typeId()) == QMet | ||||
aType::QRegion) { | ||||
mask = get<QRegion>(std::move(maskProperty)); | ||||
const QPoint floatingTranslucentItemOffset = rootObject->pr | ||||
operty("floatingTranslucentItemOffset").toPoint(); | ||||
mask.translate(floatingTranslucentItemOffset); | ||||
} | ||||
} | ||||
if (mask.isEmpty()) { | ||||
mask = QRegion(QRect(screenPanelRect)); | ||||
} | ||||
// We use mask for graphical effect which tightly covers the panel | // We use mask for graphical effect which tightly covers the panel | |||
// For the input region (QWindow::mask) screenPanelRect includes ar ea around the floating | // For the input region (QWindow::mask) screenPanelRect includes ar ea around the floating | |||
// panel in order to respect Fitt's law | // panel in order to respect Fitt's law | |||
KWindowEffects::enableBlurBehind(this, m_theme.blurBehindEnabled(), mask); | KWindowEffects::enableBlurBehind(this, m_theme.blurBehindEnabled(), mask); | |||
KWindowEffects::enableBackgroundContrast(this, | KWindowEffects::enableBackgroundContrast(this, | |||
m_theme.backgroundContrast Enabled(), | m_theme.backgroundContrast Enabled(), | |||
m_theme.backgroundContrast (), | m_theme.backgroundContrast (), | |||
m_theme.backgroundIntensit y(), | m_theme.backgroundIntensit y(), | |||
m_theme.backgroundSaturati on(), | m_theme.backgroundSaturati on(), | |||
mask); | mask); | |||
End of changes. 3 change blocks. | ||||
18 lines changed or deleted | 22 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |