-
Notifications
You must be signed in to change notification settings - Fork 7
Show tooltip with shortcut for chat, remove icon from Dock #320
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -67,7 +67,7 @@ struct KeyboardShortcutView: View { | |||||||||
| Text(title + ":") | ||||||||||
| .padding(.trailing, 8) | ||||||||||
|
|
||||||||||
| KeyBindingInputView(keyboardShortcut: $keyboardShortcut, lineHeight: Constants.lineHeight) | ||||||||||
| KeyBindingInputView(keyboardShortcut: $keyboardShortcut, defaultValue: defaultValue, lineHeight: Constants.lineHeight) | ||||||||||
|
|
||||||||||
| Spacer(minLength: 0) | ||||||||||
|
|
||||||||||
|
|
@@ -111,24 +111,14 @@ struct KeyboardShortcutView: View { | |||||||||
|
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| extension KeyboardShortcut { | ||||||||||
| /// A string representation of the key binding. | ||||||||||
| var display: String { | ||||||||||
| ( | ||||||||||
| modifiers | ||||||||||
| .map(\.description) | ||||||||||
| + [key.description]) | ||||||||||
| .joined(separator: " ") | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // MARK: - KeyBindingInputView | ||||||||||
|
|
||||||||||
| struct KeyBindingInputView: View { | ||||||||||
| init(keyboardShortcut: Binding<KeyboardShortcut?>, lineHeight: CGFloat = 20) { | ||||||||||
| init(keyboardShortcut: Binding<KeyboardShortcut?>, defaultValue: KeyboardShortcut, lineHeight: CGFloat = 20) { | ||||||||||
| _keyboardShortcut = keyboardShortcut | ||||||||||
| self.defaultValue = defaultValue | ||||||||||
| self.lineHeight = lineHeight | ||||||||||
| _inputShortcut = .init(initialValue: NSAttributedString(string: keyboardShortcut.wrappedValue?.display ?? "")) | ||||||||||
| _inputShortcut = .init(initialValue: NSAttributedString(string: (keyboardShortcut.wrappedValue ?? defaultValue).display)) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| var body: some View { | ||||||||||
|
|
@@ -152,14 +142,15 @@ struct KeyBindingInputView: View { | |||||||||
| borderColor: colorScheme.textAreaBorderColor, | ||||||||||
| borderWidth: 0.5) | ||||||||||
| .onChange(of: keyboardShortcut) { newValue in | ||||||||||
| inputShortcut = NSAttributedString(string: newValue?.display ?? "") | ||||||||||
| inputShortcut = NSAttributedString(string: (newValue ?? defaultValue).display) | ||||||||||
|
||||||||||
| inputShortcut = NSAttributedString(string: (newValue ?? defaultValue).display) | |
| if let shortcut = newValue { | |
| inputShortcut = NSAttributedString(string: shortcut.display) | |
| } |
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.
The phrase "instead of showing having a jaggy scrolling" is grammatically incorrect. It should be "instead of having jaggy scrolling" or "instead of showing a jaggy scrolling effect".