FIX: StaticGroup constriant layout badge on macOS

Change-Id: Ia93c91b990ec3f5fef3eae57d48ca71b4a0841e6
Jira: STUDIO-10383
(cherry picked from commit 88521a06d12cd4ebbcb8e98d8c929e9815aa71de)
This commit is contained in:
chunmao.guo
2025-02-14 21:35:29 +08:00
committed by Noisyfox
parent 09df1248c0
commit e746ef0451
4 changed files with 13 additions and 24 deletions

View File

@@ -16,6 +16,7 @@ void set_tag_when_enter_full_screen(bool isfullscreen);
void set_title_colour_after_set_title(void * window);
void initGestures(void * view, wxEvtHandler * handler);
void openFolderForFile(wxString const & file);
void StaticGroup_layoutBadge(void * group, void * badge);
#endif

View File

@@ -417,3 +417,12 @@ void initGestures(void * view, wxEvtHandler * handler)
}
}
void StaticGroup_layoutBadge(void * group, void * badge)
{
NSView * vg = (NSView *)group;
NSView * vb = (NSView *)badge;
vb.translatesAutoresizingMaskIntoConstraints = NO;
[vg addConstraint: [NSLayoutConstraint constraintWithItem:vb attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:vg attribute:NSLayoutAttributeTop multiplier:1.0 constant:15]];
[vg addConstraint: [NSLayoutConstraint constraintWithItem:vb attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:vg attribute:NSLayoutAttributeRight multiplier:1.0 constant:-1]];
}