Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezeshadowhelper.cpp
Show First 20 Lines • Show All 287 Lines • ▼ Show 20 Line(s) | 274 | { | |||
---|---|---|---|---|---|
288 | 288 | | |||
289 | const QColor color = StyleConfigData::shadowColor(); | 289 | const QColor color = StyleConfigData::shadowColor(); | ||
290 | const qreal strength = static_cast<qreal>(StyleConfigData::shadowStrength()) / 255.0; | 290 | const qreal strength = static_cast<qreal>(StyleConfigData::shadowStrength()) / 255.0; | ||
291 | 291 | | |||
292 | const QSize boxSize = BoxShadowRenderer::calculateMinimumBoxSize(params.shadow1.radius) | 292 | const QSize boxSize = BoxShadowRenderer::calculateMinimumBoxSize(params.shadow1.radius) | ||
293 | .expandedTo(BoxShadowRenderer::calculateMinimumBoxSize(params.shadow2.radius)); | 293 | .expandedTo(BoxShadowRenderer::calculateMinimumBoxSize(params.shadow2.radius)); | ||
294 | 294 | | |||
295 | #if QT_VERSION >= 0x050300 | 295 | #if QT_VERSION >= 0x050300 | ||
296 | const qreal dpr = qApp->devicePixelRatio(); | 296 | const qreal dpr = Helper::isWayland() ? 1.0 : qApp->devicePixelRatio(); | ||
297 | #else | 297 | #else | ||
298 | const qreal dpr = 1.0; | 298 | const qreal dpr = 1.0; | ||
299 | #endif | 299 | #endif | ||
300 | 300 | | |||
301 | const qreal frameRadius = _helper.frameRadius(); | 301 | const qreal frameRadius = _helper.frameRadius(); | ||
302 | 302 | | |||
303 | BoxShadowRenderer shadowRenderer; | 303 | BoxShadowRenderer shadowRenderer; | ||
304 | shadowRenderer.setBorderRadius(frameRadius); | 304 | shadowRenderer.setBorderRadius(frameRadius); | ||
▲ Show 20 Lines • Show All 306 Lines • ▼ Show 20 Line(s) | 608 | #endif | |||
611 | const int diff = qAbs(top - bottom); | 611 | const int diff = qAbs(top - bottom); | ||
612 | if (top > bottom) { | 612 | if (top > bottom) { | ||
613 | margins.setTop(margins.top() - diff); | 613 | margins.setTop(margins.top() - diff); | ||
614 | } else { | 614 | } else { | ||
615 | margins.setBottom(margins.bottom() - diff); | 615 | margins.setBottom(margins.bottom() - diff); | ||
616 | } | 616 | } | ||
617 | } | 617 | } | ||
618 | 618 | | |||
619 | if (!Helper::isWayland()) { | ||||
619 | #if BREEZE_USE_KDE4 | 620 | #if BREEZE_USE_KDE4 | ||
620 | const qreal dpr = _helper.devicePixelRatio(_shadowTiles.pixmap(0)); | 621 | const qreal dpr = _helper.devicePixelRatio(_shadowTiles.pixmap(0)); | ||
621 | margins.setLeft(margins.left() * dpr); | 622 | margins.setLeft(margins.left() * dpr); | ||
622 | margins.setTop(margins.top() * dpr); | 623 | margins.setTop(margins.top() * dpr); | ||
623 | margins.setRight(margins.right() * dpr); | 624 | margins.setRight(margins.right() * dpr); | ||
624 | margins.setBottom(margins.bottom() * dpr); | 625 | margins.setBottom(margins.bottom() * dpr); | ||
625 | #else | 626 | #else | ||
626 | margins *= _helper.devicePixelRatio(_shadowTiles.pixmap(0)); | 627 | margins *= _helper.devicePixelRatio(_shadowTiles.pixmap(0)); | ||
627 | #endif | 628 | #endif | ||
629 | } | ||||
628 | 630 | | |||
629 | return margins; | 631 | return margins; | ||
630 | } | 632 | } | ||
631 | 633 | | |||
632 | //_______________________________________________________ | 634 | //_______________________________________________________ | ||
633 | void ShadowHelper::uninstallShadows( QWidget* widget ) const | 635 | void ShadowHelper::uninstallShadows( QWidget* widget ) const | ||
634 | { | 636 | { | ||
635 | if( !( widget && widget->testAttribute(Qt::WA_WState_Created) ) ) return; | 637 | if( !( widget && widget->testAttribute(Qt::WA_WState_Created) ) ) return; | ||
Show All 34 Lines |