-
Notifications
You must be signed in to change notification settings - Fork 8
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
serve local file for background image #166
Conversation
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.
LGTM
@State private var openPanel = NSOpenPanel() | ||
|
||
func selectImage() { | ||
mkdirP(imageDir.localPath()) |
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.
(This seems not satisfying, but acceptable anyway)
var fileName = file.lastPathComponent | ||
if !imageDir.contains(file) { | ||
if !copyFile(file, imageDir.appendingPathComponent(fileName)) { | ||
return |
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.
I think we should add an error message here, at least in the log file
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.
copyFile already logs on fail.
What I want to improve in the future is to provide a convenient way to trigger an AlertToast from nested subview to window's major view. Currently the only place that does the similar thing is
fcitx5-macos/src/config/inputmethod.swift
Lines 215 to 228 in e14a44a
ImportTableView().load( | |
onError: { msg in | |
importTableErrorMsg = msg | |
showImportTableError = true | |
}, | |
finalize: { | |
refresh() | |
}) | |
} | |
.toast(isPresenting: $showImportTableError) { | |
AlertToast( | |
displayMode: .hud, | |
type: .error(Color.red), title: importTableErrorMsg) | |
} |
Please update submodule on merge.