gpt4 book ai didi

objective-c - 改变 NSPopover 的外观?

转载 作者:搜寻专家 更新时间:2023-10-30 20:25:39 26 4
gpt4 key购买 nike

我想制作一个与此类似的 NSPopover:

screenshot

所以我想覆盖绘图。

很遗憾,我没有在 Apple 文档中找到任何内容。但是,我确实使用类转储找到了以下私有(private)类:

@interface NSPopoverFrame : NSView
{
const void *_themeX;
long long _popoverAppearance;
NSImage *_dragImage;
unsigned long long _anchorEdge;
struct CGSize _anchorSize;
CDStruct_3c058996 _contentInset;
struct CGPoint _anchorPoint;
unsigned long long _previousAnchorEdge;
struct CGPoint _previousAnchorPoint;
unsigned int _windowFilter;
struct {
unsigned int useDragWindowAppearance:1;
unsigned int hasActiveShadow:1;
unsigned int hasShadow:1;
unsigned int invalidateShadow:1;
unsigned int hasWindowBackgroundBlur:1;
unsigned int shouldBlurBackground:1;
unsigned int shouldInsetForAnchor:1;
unsigned int doingSolidFillHack:1;
} _flags;
}

+ (struct CGRect)contentRectForFrameRect:(struct CGRect)arg1 styleMask:(unsigned long long)arg2;
+ (struct CGRect)frameRectForContentRect:(struct CGRect)arg1 styleMask:(unsigned long long)arg2;
+ (struct CGRect)contentRectForFrameRect:(struct CGRect)arg1 appearance:(long long)arg2 anchorSize:(struct CGSize)arg3 contentInset:(CDStruct_3c058996)arg4;
+ (struct CGRect)frameRectForContentRect:(struct CGRect)arg1 appearance:(long long)arg2 anchorSize:(struct CGSize)arg3 contentInset:(CDStruct_3c058996)arg4;
@property struct CGPoint anchorPoint; // @synthesize anchorPoint=_anchorPoint;
@property long long popoverAppearance; // @synthesize popoverAppearance=_popoverAppearance;
@property CDStruct_3c058996 contentInset; // @synthesize contentInset=_contentInset;
@property struct CGSize anchorSize; // @synthesize anchorSize=_anchorSize;
@property unsigned long long anchorEdge; // @synthesize anchorEdge=_anchorEdge;
- (struct CGRect)titlebarRect;
- (BOOL)_hasActiveDragTypes;
- (void)draggingEnded:(id)arg1;
- (void)concludeDragOperation:(id)arg1;
- (BOOL)performDragOperation:(id)arg1;
- (void)draggingExited:(id)arg1;
- (unsigned long long)draggingEntered:(id)arg1;
- (void)_markAnchorRectAsNeedingDisplay;
- (void)setFrameSize:(struct CGSize)arg1;
- (BOOL)_isBorderView;
- (void)_drawFrameShadowAndFlushContext:(id)arg1;
- (void)tileAndSetWindowShape:(BOOL)arg1;
- (void)shapeWindow;
- (void)_setFrameNeedsDisplay:(BOOL)arg1;
- (id)opaqueAncestor;
- (BOOL)isOpaque;
- (struct CGRect)dragRectForFrameRect:(struct CGRect)arg1;
- (void)_resetDragMargins;
- (void)_clearDragMargins;
- (double)_distanceFromToolbarBaseToTitlebar;
- (void)_hideToolbarWithAnimation:(BOOL)arg1;
- (void)_showToolbarWithAnimation:(BOOL)arg1;
- (BOOL)_toolbarIsManagedByExternalWindow;
- (BOOL)_toolbarIsHidden;
- (BOOL)_toolbarIsShown;
- (BOOL)_toolbarIsInTransition;
- (BOOL)_canHaveToolbar;
- (id)zoomButton;
- (id)minimizeButton;
- (id)closeButton;
- (unsigned long long)styleMask;
- (id)title;
- (void)_windowChangedKeyState;
- (void)drawRect:(struct CGRect)arg1;
- (struct CGPoint)_adjustedForBoundsAnchorPoint:(struct CGPoint)arg1 anchorEdge:(unsigned long long)arg2;
- (id)_getPopoverIfAvailable;
- (void)drawBackgroundInRect:(struct CGRect)arg1 ofView:(id)arg2 anchorEdge:(unsigned long long)arg3 anchorPoint:(struct CGPoint)arg4;
- (void)_drawHUDPopoverAppearanceInRect:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3;
- (void)_drawMinimalPopoverAppearanceInRect:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3;
- (struct CGImage *)_imageMaskForPath:(struct CGPath *)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3;
- (struct CGPath *)_newMinimalAppearancePathInBounds:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3 topCapOnly:(BOOL)arg4 arrowOffset:(double)arg5;
- (struct CGPath *)_newMinimalAppearancePathInBounds:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 arrowPosition:(double)arg3 topCapOnly:(BOOL)arg4 arrowOffset:(double)arg5;
- (void)_setHasDragWindowAppearance:(BOOL)arg1;
- (BOOL)_hasDragWindowAppearance;
- (void)_tileAndRedisplay:(BOOL)arg1;
- (struct CGRect)contentRectForFrameRect:(struct CGRect)arg1 styleMask:(unsigned long long)arg2;
- (struct CGRect)frameRectForContentRect:(struct CGRect)arg1 styleMask:(unsigned long long)arg2;
- (void)_setDragImage:(id)arg1;
- (id)_dragImage;
- (void)dealloc;
- (void)_windowTransformAnimationDidEnd:(id)arg1;
- (void)_windowTransformAnimationWillBegin:(id)arg1;
- (void)viewDidMoveToWindow;
- (void)_loadTheme;
- (void)viewWillDraw;
@property BOOL shouldBlurBackground;
- (void)_setWindowBackgroundBlurIfNeeded;
- (BOOL)_canHaveBlur;
- (void)_invalidateShadow;
@property BOOL shouldInsetForAnchor; // @dynamic shouldInsetForAnchor;
- (id)initWithCoder:(id)arg1;
- (id)initWithFrame:(struct CGRect)arg1 styleMask:(unsigned long long)arg2 owner:(id)arg3;
- (id)initWithFrame:(struct CGRect)arg1;
- (void)_commonPopoverInit;

@end

然后我可以子类化 _NSPopoverWindow,它也是私有(private)的,并覆盖

+ (Class)frameViewClassForStyleMask:(unsigned long long)arg1;

我不能继承它因为它是私有(private)的..有办法绕过这个吗?

或者还有其他方法吗?

最佳答案

我在 Github 上找到了这个很棒的存储库:

https://github.com/github/Rebel

完全符合我的要求。

关于objective-c - 改变 NSPopover 的外观?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13892566/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com