-
Notifications
You must be signed in to change notification settings - Fork 83
[222_48] : fix macOS shortcut issue #2935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Fix macOS keyboard shortcuts in file chooser dialog | ||
|
|
||
| ## How to test | ||
| 1. Open Mogan on macOS | ||
| 2. Open the file dialog (File > Save or similar actions) | ||
| 3. The keyboard shortcuts should work properly: | ||
| - Command+V (paste) | ||
| - Command+C (copy) | ||
| - Other standard macOS shortcuts | ||
|
|
||
| ## Fix macOS file chooser dialog keyboard shortcuts | ||
| ### What | ||
| Fixed issue #2894: keyboard shortcuts (Command+V, Command+C, etc.) not working in the file chooser dialog on macOS. | ||
|
|
||
| ### Why | ||
| when Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -286,6 +286,12 @@ qt_chooser_widget_rep::perform_dialog () { | |
|
|
||
| QFileDialog* dialog= new QFileDialog (this->as_qwidget (), caption, path); | ||
|
|
||
| #ifdef OS_MACOS | ||
| // Use Qt's custom dialog on macOS to fix keyboard shortcuts | ||
| // (Command+V, Command+C, etc.) | ||
| dialog->setOption (QFileDialog::DontUseNativeDialog, true); | ||
| #endif | ||
|
Comment on lines
+289
to
+293
|
||
|
|
||
| dialog->setViewMode (QFileDialog::Detail); | ||
| if (type == "directory") dialog->setFileMode (QFileDialog::Directory); | ||
| else if (type == "image" && prompt == "") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sentence casing: start this sentence with a capital letter ("When") since it begins a new paragraph.