mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 00:47:34 +08:00
Merge branch 'osx-window-invalidate-inset-cache' of github.com:ryancog/wxWidgets
Add wxWindow::MacInvalidateInsetCache() to wxOSX/Cocoa. See #26625. Closes #26622.
This commit is contained in:
@@ -204,6 +204,10 @@ public:
|
||||
virtual long MacGetTopBorderSize() const;
|
||||
virtual long MacGetBottomBorderSize() const;
|
||||
|
||||
// Must be called whenever window style changes result in changes to layout
|
||||
// insets (`-[NSView alignmentRectInsets:]`, used for MacGetBorderSize())
|
||||
virtual void MacInvalidateInsetCache() const;
|
||||
|
||||
virtual void MacSuperChangedPosition() ;
|
||||
|
||||
// absolute coordinates of this window's root have changed
|
||||
|
||||
@@ -66,6 +66,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setBezelStyle: (NSBezelStyle) s
|
||||
{
|
||||
[super setBezelStyle:s];
|
||||
|
||||
// Setting the bezel style may change the layout insets, so the cache
|
||||
// needs to be invalidated to avoid incorrect layout.
|
||||
// Done here so it's handled for both internal wx usage and application
|
||||
// code when accessed with `wxWindow::GetHandle()`
|
||||
auto *impl{wxWidgetImpl::FindFromWXWidget(self)};
|
||||
if (impl)
|
||||
impl->InvalidateLayoutInset();
|
||||
}
|
||||
|
||||
- (void) setTrackingTag: (NSTrackingRectTag)tag
|
||||
{
|
||||
rectTag = tag;
|
||||
|
||||
@@ -2344,6 +2344,11 @@ long wxWindowMac::MacGetBottomBorderSize() const {
|
||||
return MacGetBorderSize().bottom;
|
||||
}
|
||||
|
||||
void wxWindowMac::MacInvalidateInsetCache() const {
|
||||
if ( GetPeer() )
|
||||
GetPeer()->InvalidateLayoutInset();
|
||||
}
|
||||
|
||||
long wxWindowMac::MacRemoveBordersFromStyle( long style )
|
||||
{
|
||||
return style & ~wxBORDER_MASK ;
|
||||
|
||||
Reference in New Issue
Block a user