5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 04:42:00 +08:00

Update docs

This commit is contained in:
Lea Anthony 2022-01-26 14:16:36 +11:00
parent bb867832e1
commit 736d8b6b04
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -75,16 +75,16 @@ type OpenDialogOptions struct {
TreatPackagesAsDirectories bool TreatPackagesAsDirectories bool
} }
``` ```
| Field | Description | Win | Mac | | Field | Description | Win | Mac | Lin |
| -------------------------- | ---------------------------------------------- | --- | --- | | -------------------------- | ---------------------------------------------- | --- | --- | --- |
| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | | DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ |
| DefaultFilename | The default filename | ✅ | ✅ | | DefaultFilename | The default filename | ✅ | ✅ | ✅ |
| Title | Title for the dialog | ✅ | ✅ | | Title | Title for the dialog | ✅ | ✅ | ✅ |
| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | | [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ |
| ShowHiddenFiles | Show files hidden by the system | | ✅ | | ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ |
| CanCreateDirectories | Allow user to create directories | | ✅ | | CanCreateDirectories | Allow user to create directories | | ✅ | |
| ResolvesAliases | If true, returns the file not the alias | | ✅ | | ResolvesAliases | If true, returns the file not the alias | | ✅ | |
| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | |
### SaveDialogOptions ### SaveDialogOptions
@ -101,15 +101,15 @@ type SaveDialogOptions struct {
} }
``` ```
| Field | Description | Win | Mac | | Field | Description | Win | Mac | Lin |
| -------------------------- | ---------------------------------------------- | --- | --- | | -------------------------- | ---------------------------------------------- | --- | --- | --- |
| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | | DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ |
| DefaultFilename | The default filename | ✅ | ✅ | | DefaultFilename | The default filename | ✅ | ✅ | ✅ |
| Title | Title for the dialog | ✅ | ✅ | | Title | Title for the dialog | ✅ | ✅ | ✅ |
| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | | [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ |
| ShowHiddenFiles | Show files hidden by the system | | ✅ | | ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ |
| CanCreateDirectories | Allow user to create directories | | ✅ | | CanCreateDirectories | Allow user to create directories | | ✅ | |
| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | |
### MessageDialogOptions ### MessageDialogOptions
@ -123,20 +123,25 @@ type MessageDialogOptions struct {
CancelButton string CancelButton string
} }
``` ```
| Field | Description | Win | Mac | | Field | Description | Win | Mac | Lin |
| ------------- | ------------------------------------------------------------------------- | --- | --- | | ------------- | ------------------------------------------------------------------------- | --- | --- | --- |
| Type | The type of message dialog, eg question, info... | ✅ | ✅ | | Type | The type of message dialog, eg question, info... | ✅ | ✅ | ✅ |
| Title | Title for the dialog | ✅ | ✅ | | Title | Title for the dialog | ✅ | ✅ | ✅ |
| Message | The message to show the user | ✅ | ✅ | | Message | The message to show the user | ✅ | ✅ | ✅ |
| Buttons | A list of button titles | | ✅ | | Buttons | A list of button titles | | ✅ | |
| DefaultButton | The button with this text should be treated as default. Bound to `return` | | ✅ | | DefaultButton | The button with this text should be treated as default. Bound to `return` | | ✅ | |
| CancelButton | The button with this text should be treated as cancel. Bound to `escape` | | ✅ | | CancelButton | The button with this text should be treated as cancel. Bound to `escape` | | ✅ | |
#### Windows #### Windows
Windows has standard dialog types in which the buttons are not customisable. Windows has standard dialog types in which the buttons are not customisable.
The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue" The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue"
#### Linux
Linux has standard dialog types in which the buttons are not customisable.
The value returned will be one of: "Ok", "Cancel", "Yes", "No"
#### Mac #### Mac
A message dialog on Mac may specify up to 4 buttons. If no `DefaultButton` or `CancelButton` is given, the first button A message dialog on Mac may specify up to 4 buttons. If no `DefaultButton` or `CancelButton` is given, the first button
@ -222,6 +227,19 @@ dialog:
<br/> <br/>
<br/> <br/>
#### Linux
Linux allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the
dialog:
<div class="text--center">
<img src="/img/runtime/dialog_lin_filters.png" width="50%" style={{"box-shadow": "rgb(255 255 255 / 20%) 0px 4px 8px 0px, rgb(104 104 104) 0px 6px 20px 0px"}}/>
</div>
<br/>
<br/>
<br/>
#### Mac #### Mac
Mac dialogs only have the concept of a single set of patterns to filter files. If multiple FileFilters are provided, Mac dialogs only have the concept of a single set of patterns to filter files. If multiple FileFilters are provided,