summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.h7
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm5
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.mm4
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm8
4 files changed, 17 insertions, 7 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h
index a2e0876073..4478895538 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.h
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.h
@@ -167,7 +167,12 @@ QT_END_NAMESPACE
- (void)onCancelClicked;
@end
-@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView
+@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView {
+ NSButton *_okButton;
+ NSButton *_cancelButton;
+ NSView *_panelContents;
+ NSEdgeInsets _panelContentsMargins;
+}
@property (nonatomic, readonly) NSButton *okButton;
@property (nonatomic, readonly) NSButton *cancelButton;
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 232e40769b..5d0f13c5a9 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -303,6 +303,11 @@ QT_END_NAMESPACE
*/
@implementation QNSPanelContentsWrapper
+@synthesize okButton = _okButton;
+@synthesize cancelButton = _cancelButton;
+@synthesize panelContents = _panelContents;
+@synthesize panelContentsMargins = _panelContentsMargins;
+
- (instancetype)initWithPanelDelegate:(id<QT_MANGLE_NAMESPACE(QNSPanelDelegate)>)panelDelegate
{
if ((self = [super initWithFrame:NSZeroRect])) {
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index 8295d4a36c..1224d138d9 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -75,7 +75,7 @@
// window.screen.visibleFrame directly, as that ensures we have the same
// behavior for both use-cases/APIs.
Q_ASSERT(window == m_cocoaWindow->nativeWindow());
- return m_cocoaWindow->screen()->availableGeometry().toCGRect();
+ return NSRectFromCGRect(m_cocoaWindow->screen()->availableGeometry().toCGRect());
}
#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
@@ -90,7 +90,7 @@
{
Q_UNUSED(proposedSize);
Q_ASSERT(window == m_cocoaWindow->nativeWindow());
- return m_cocoaWindow->screen()->geometry().size().toCGSize();
+ return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
}
#endif
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 99526683dd..6e8796970f 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1018,17 +1018,17 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h
NSBezierPath *focusRingPath;
if (radius > 0) {
const CGFloat roundedRectInset = -1.5;
- focusRingPath = [NSBezierPath bezierPathWithRoundedRect:CGRectInset(focusRingRect, roundedRectInset, roundedRectInset)
+ focusRingPath = [NSBezierPath bezierPathWithRoundedRect:NSRectFromCGRect(CGRectInset(focusRingRect, roundedRectInset, roundedRectInset))
xRadius:radius
yRadius:radius];
} else {
const CGFloat outerClipInset = -focusRingWidth / 2;
- NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, outerClipInset, outerClipInset)];
+ NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, outerClipInset, outerClipInset))];
const CGFloat innerClipInset = 1;
- NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, innerClipInset, innerClipInset)];
+ NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, innerClipInset, innerClipInset))];
[focusRingClipPath appendBezierPath:focusRingInnerClipPath.bezierPathByReversingPath];
[focusRingClipPath setClip];
- focusRingPath = [NSBezierPath bezierPathWithRect:focusRingRect];
+ focusRingPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(focusRingRect)];
focusRingPath.lineJoinStyle = NSRoundLineJoinStyle;
}