From 2bea439c807c71fd54b093c663477f6602866436 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 15 Jul 2020 12:45:20 +0200 Subject: [PATCH] limiting the focus indicator to the window --- src/controls/QskFocusIndicator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/controls/QskFocusIndicator.cpp b/src/controls/QskFocusIndicator.cpp index 4ad21744..b1c428a9 100644 --- a/src/controls/QskFocusIndicator.cpp +++ b/src/controls/QskFocusIndicator.cpp @@ -148,6 +148,15 @@ void QskFocusIndicator::updateFocusFrame() if ( !r.isEmpty() ) { r = r.marginsAdded( marginsHint( Panel | QskAspect::Padding ) ); + + if ( auto w = window() ) + { + QRectF clipRect( 0, 0, w->width(), w->height() ); + clipRect = parentItem()->mapRectFromScene( clipRect ); + + r = r.intersected( clipRect ); + } + setGeometry( r ); const auto clipRect = qskFocusIndicatorClipRect( m_data->clippingItem );