diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-10-18 12:11:39 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-10-18 12:11:39 +0300 |
commit | a3cb6163ccd20ff3c48c4177c77f61ddf59b8559 (patch) | |
tree | 15928fd8f3540308a5d3ea66ce6c98f154b6109c /platform/macos | |
parent | 2e3662acbd8586697db38569785cc9f97dff945e (diff) |
[macOS] Fit OS::alert to the text width for better readability.
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/os_macos.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index ae8534f6ab..8ffb0abfdb 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -148,9 +148,11 @@ void OS_MacOS::alert(const String &p_alert, const String &p_title) { NSString *ns_title = [NSString stringWithUTF8String:p_title.utf8().get_data()]; NSString *ns_alert = [NSString stringWithUTF8String:p_alert.utf8().get_data()]; + NSTextField *text_field = [NSTextField labelWithString:ns_alert]; + [text_field setAlignment:NSTextAlignmentCenter]; [window addButtonWithTitle:@"OK"]; [window setMessageText:ns_title]; - [window setInformativeText:ns_alert]; + [window setAccessoryView:text_field]; [window setAlertStyle:NSAlertStyleWarning]; id key_window = [[NSApplication sharedApplication] keyWindow]; |