diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2022-10-19 21:52:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 21:52:40 +0200 |
commit | 21c90b4c7df08128d39232fae65d873e8723c8fd (patch) | |
tree | d81d0e3533e98fd9634c991520e9e943375c2700 | |
parent | b209065e89f2ac6f3b03d2f7b354fe8d8e2afd05 (diff) | |
parent | a3cb6163ccd20ff3c48c4177c77f61ddf59b8559 (diff) |
Merge pull request #67564 from bruvzg/macos_wide_alert
[macOS] Fit OS::alert to the text width for better readability.
-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]; |