Skip to content

Commit

Permalink
新功能:添加了一些快捷键
Browse files Browse the repository at this point in the history
  • Loading branch information
GaiZhenbiao committed Feb 4, 2023
1 parent 7b2b9ba commit cb304c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChuanhuWallpaper/Components/SaveButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct SaveButton: View {
.alert(isPresented: $showErrorMessage) {
Alert(title: Text("An Error Occured"), message: Text(errorMessage), dismissButton: .cancel())
}
.keyboardShortcut("s")
}

private func save() {
Expand Down
1 change: 1 addition & 0 deletions ChuanhuWallpaper/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct ContentView: View {
.foregroundColor(.red)
}
}
.keyboardShortcut(KeyEquivalent.escape, modifiers: [])
.offset(x: wallpapers.isEmpty ? 200 : 0)
.animation(.spring(), value: wallpapers)
, alignment: .trailing
Expand Down
1 change: 1 addition & 0 deletions ChuanhuWallpaper/View/WallpaperPlaceholderCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct WallpaperPlaceholderCell: View {
} label: {
Text("Choose Photo(s)...").fixedSize(horizontal: false, vertical: true)
}
.keyboardShortcut("i")
}
}

Expand Down

0 comments on commit cb304c7

Please sign in to comment.