mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-21 19:26:09 +03:00
macOS: add description as hover tooltip
This commit is contained in:
@ -3,6 +3,7 @@ import SwiftUI
|
|||||||
struct CommandOption: Identifiable, Hashable {
|
struct CommandOption: Identifiable, Hashable {
|
||||||
let id = UUID()
|
let id = UUID()
|
||||||
let title: String
|
let title: String
|
||||||
|
let description: String?
|
||||||
let shortcut: String?
|
let shortcut: String?
|
||||||
let action: () -> Void
|
let action: () -> Void
|
||||||
|
|
||||||
@ -222,6 +223,7 @@ fileprivate struct CommandRow: View {
|
|||||||
)
|
)
|
||||||
.cornerRadius(6)
|
.cornerRadius(6)
|
||||||
}
|
}
|
||||||
|
.help(option.description ?? "")
|
||||||
.buttonStyle(PlainButtonStyle())
|
.buttonStyle(PlainButtonStyle())
|
||||||
.onHover { hovering in
|
.onHover { hovering in
|
||||||
hoveredID = hovering ? option.id : nil
|
hoveredID = hovering ? option.id : nil
|
||||||
|
@ -39,6 +39,7 @@ struct TerminalCommandPaletteView: View {
|
|||||||
let action = String(cString: c.action)
|
let action = String(cString: c.action)
|
||||||
return CommandOption(
|
return CommandOption(
|
||||||
title: String(cString: c.title),
|
title: String(cString: c.title),
|
||||||
|
description: String(cString: c.description),
|
||||||
shortcut: ghosttyConfig.keyboardShortcut(for: action)?.description
|
shortcut: ghosttyConfig.keyboardShortcut(for: action)?.description
|
||||||
) {
|
) {
|
||||||
onAction(action)
|
onAction(action)
|
||||||
|
Reference in New Issue
Block a user