Repository navigation
Add desktop extended MessageDialog support and non-blocking macOS sheets - #108
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses libnativeapi/nativeapi#64.
Summary
MessageDialog::IsExtendedSupported()across all three desktop backends (macOS, Windows Win32, Linux GTK 3):NSAlert): creates a freshNSAlertperOpen(), adds configuredprimary/secondary/closebuttons, configures Return (default) and Escape (close) key equivalents after[alert layout], maps responses toMessageDialogResult, and supports checkbox (suppressionButton), text input, and live-updating progress bar (accessoryView).Close(): whenSetParentWindowis set, presents viabeginSheetModalForWindow:completionHandler:so the calling thread is not blocked, updatesIsOpen()/GetResult()on dismissal, and implementsClose()viaendSheet:returnCode:(with[NSApp abortModal]for parentless modal alerts).TaskDialogIndirect(activating a ComCtl32 v6 context viashell32.dllresource124when the host has no v6 manifest, falling back toMessageBoxWif unavailable), wiring customTASKDIALOG_BUTTONs,nDefaultButton,hwndParent, checkbox, progress bar (with live updates), andClose()viaTDM_CLICK_BUTTON.GTK_BUTTONS_NONE+gtk_dialog_add_button+gtk_dialog_set_default_response, supports parent window, maps responses toMessageDialogResult, adds optional input/checkbox/progress widgets to the message area, and destroys modal dialogs cleanly aftergtk_dialog_run.src/message_dialog.h.message_dialog_extended_test(cross-platform) andmessage_dialog_macos_sheet_test(macOS sheet lifecycle, custom buttons, key equivalents, live progress, and programmaticClose()).Verification
message_dialog_extended_testandmessage_dialog_macos_sheet_testpass locally.