Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 27, 2022
1 parent 1fdbd70 commit 3cdab0c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Color Picker/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ final class AppState: ObservableObject {
let item = $0

$0.button!.onAction { [self] event in
let isAlternative = event.isAlternateClickForStatusItem
let isAlternative = event.isAlternativeClickForStatusItem

let showMenu = {
item.showMenu(createMenu())
Expand Down
5 changes: 5 additions & 0 deletions Color Picker/SettingsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ private struct GeneralSettings: View {
}
.disabled(!showInMenuBar)
.padding(.leading, 19)
Button("Feedback & Support") {
SSApp.openSendFeedbackPage()
}
.buttonStyle(.link)
.padding(.top)
}
}
.padding()
Expand Down
19 changes: 12 additions & 7 deletions Color Picker/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ typealias XColor = UIColor
#endif


//func delay(seconds: TimeInterval, closure: @escaping () -> Void) {
// Task.detached {
// try? await Task.sleep(seconds: seconds)
// closure()
// }
//}

// TODO: Don't make this use `Task` for at least another two years (2024). There are a lot of things that don't work with `Task`.
func delay(seconds: TimeInterval, closure: @escaping () -> Void) {
Task.detached {
try? await Task.sleep(seconds: seconds)
closure()
}
DispatchQueue.main.asyncAfter(deadline: .now() + seconds, execute: closure)
}


Expand Down Expand Up @@ -2837,13 +2842,13 @@ extension NSEvent {


extension NSEvent {
var isAlternateMouseUp: Bool {
var isAlternativeMouseUp: Bool {
type == .rightMouseUp
|| (type == .leftMouseUp && modifiers == .control)
}

var isAlternateClickForStatusItem: Bool {
isAlternateMouseUp
var isAlternativeClickForStatusItem: Bool {
isAlternativeMouseUp
|| (type == .leftMouseUp && modifiers == .option)
}
}

0 comments on commit 3cdab0c

Please sign in to comment.