Skip to content

Commit

Permalink
[macOS] Use message instead of title (#166)
Browse files Browse the repository at this point in the history
Open panels do not have a title bar on modern macOS, so set the
'message' property instead:
https://developer.apple.com/documentation/appkit/nssavepanel/1528581-message
  • Loading branch information
NobodyNada authored Jan 8, 2024
1 parent 79f1254 commit 0e64ca7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/macos/file_dialog/panel_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl Panel {
pub fn set_title(&self, title: &str) {
unsafe {
let title = make_nsstring(title);
let () = msg_send![self.panel, setTitle: title];
let () = msg_send![self.panel, setMessage: title];
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/file_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl FileDialog {
/// Set the title of the dialog. Supported platforms:
/// * Windows
/// * Linux
/// * Mac (Only below version 10.11)
/// * Mac
pub fn set_title(mut self, title: impl Into<String>) -> Self {
self.title = Some(title.into());
self
Expand Down Expand Up @@ -189,7 +189,7 @@ impl AsyncFileDialog {
/// Set the title of the dialog. Supported platforms:
/// * Windows
/// * Linux
/// * Mac (Only below version 10.11)
/// * Mac
/// * WASM32
pub fn set_title(mut self, title: impl Into<String>) -> Self {
self.file_dialog = self.file_dialog.set_title(title);
Expand Down

0 comments on commit 0e64ca7

Please sign in to comment.