diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2016-02-24 17:19:37 -0800 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2016-03-17 16:57:31 +0000 |
commit | 7c7ece94429d6e12e0543c275d26fd90501193ff (patch) | |
tree | 3718c38c165e4484c21e491c02791caaacdb1a4f /src/widgets/styles/qmacstyle_mac_p_p.h | |
parent | c6bf48dcbfd6b1048cddfd127b95dce27815709f (diff) |
QMacStyle: Ensure proper focus ring clipping
By rendering the focus ring directly on the backing NSView, we
would ignore the painter's clipping information. It would also
require creating a custom CGContext and attached NSGraphicsContext
every time.
The first step is to render the focus ring on a pixmap and then
use the painter to render that pixamp. This ensures the clipping
is done properly. The second step is to cache said pixmap and
render it as a nine-patch image.
Change-Id: I1df1baf7dc490023319f025a16306d4f04e5264c
Task-number: QTBUG-50645
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/widgets/styles/qmacstyle_mac_p_p.h')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac_p_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index 33818568ec..b2c76c2d76 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -209,6 +209,8 @@ public: void drawNSViewInRect(QCocoaWidget widget, NSView *view, const QRect &rect, QPainter *p, bool isQWidget = true, QCocoaDrawRectBlock drawRectBlock = nil) const; void resolveCurrentNSView(QWindow *window); + void drawFocusRing(QPainter *p, const QRect &targetRect, int hMargin, int vMargin, qreal radius = 0) const; + public: mutable QPointer<QObject> pressedButton; mutable QPointer<QObject> defaultButton; |