mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
allow directory selection
This commit is contained in:
parent
38f6b1297d
commit
105d9f0d3a
2 changed files with 17 additions and 2 deletions
|
|
@ -1579,7 +1579,13 @@ func runChooserDialog(window pointer, allowMultiple, createFolders, showHidden b
|
|||
}
|
||||
|
||||
func runOpenFileDialog(dialog *OpenFileDialogStruct) (chan string, error) {
|
||||
const GtkFileChooserActionOpen = C.GTK_FILE_CHOOSER_ACTION_OPEN
|
||||
var action int
|
||||
|
||||
if dialog.canChooseDirectories {
|
||||
action = C.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
|
||||
} else {
|
||||
action = C.GTK_FILE_CHOOSER_ACTION_OPEN
|
||||
}
|
||||
|
||||
window := nilPointer
|
||||
if dialog.window != nil {
|
||||
|
|
@ -1598,7 +1604,7 @@ func runOpenFileDialog(dialog *OpenFileDialogStruct) (chan string, error) {
|
|||
dialog.showHiddenFiles,
|
||||
dialog.directory,
|
||||
dialog.title,
|
||||
GtkFileChooserActionOpen,
|
||||
action,
|
||||
buttonText,
|
||||
dialog.filters)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1084,6 +1084,15 @@ func runChooserDialog(window pointer, allowMultiple, createFolders, showHidden b
|
|||
// dialog related
|
||||
func runOpenFileDialog(dialog *OpenFileDialogStruct) ([]string, error) {
|
||||
const GtkFileChooserActionOpen = 0
|
||||
const GtkFileChooserActionSelectFolder = 2
|
||||
|
||||
var action int
|
||||
|
||||
if dialog.canChooseDirectories {
|
||||
action = GtkFileChooserActionSelectFolder
|
||||
} else {
|
||||
action = GtkFileChooserActionOpen
|
||||
}
|
||||
|
||||
window := pointer(0)
|
||||
if dialog.window != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue