mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macOS: fix crosshair verticalText and contextMenu pointerStyles
This commit is contained in:
@ -360,14 +360,14 @@ extension Ghostty {
|
|||||||
pointerStyle = .resizeLeftRight
|
pointerStyle = .resizeLeftRight
|
||||||
|
|
||||||
case GHOSTTY_MOUSE_SHAPE_VERTICAL_TEXT:
|
case GHOSTTY_MOUSE_SHAPE_VERTICAL_TEXT:
|
||||||
pointerStyle = .default
|
pointerStyle = .verticalText
|
||||||
|
|
||||||
// These are not yet supported. We should support them by constructing a
|
|
||||||
// PointerStyle from an NSCursor.
|
|
||||||
case GHOSTTY_MOUSE_SHAPE_CONTEXT_MENU:
|
|
||||||
fallthrough
|
|
||||||
case GHOSTTY_MOUSE_SHAPE_CROSSHAIR:
|
case GHOSTTY_MOUSE_SHAPE_CROSSHAIR:
|
||||||
fallthrough
|
pointerStyle = .crosshair
|
||||||
|
|
||||||
|
case GHOSTTY_MOUSE_SHAPE_CONTEXT_MENU:
|
||||||
|
pointerStyle = .contextMenu
|
||||||
|
|
||||||
case GHOSTTY_MOUSE_SHAPE_NOT_ALLOWED:
|
case GHOSTTY_MOUSE_SHAPE_NOT_ALLOWED:
|
||||||
pointerStyle = .default
|
pointerStyle = .default
|
||||||
|
|
||||||
|
@ -61,6 +61,8 @@ enum BackportVisibility {
|
|||||||
|
|
||||||
enum BackportPointerStyle {
|
enum BackportPointerStyle {
|
||||||
case `default`
|
case `default`
|
||||||
|
case contextMenu
|
||||||
|
case crosshair
|
||||||
case grabIdle
|
case grabIdle
|
||||||
case grabActive
|
case grabActive
|
||||||
case horizontalText
|
case horizontalText
|
||||||
@ -78,6 +80,8 @@ enum BackportPointerStyle {
|
|||||||
var official: PointerStyle {
|
var official: PointerStyle {
|
||||||
switch self {
|
switch self {
|
||||||
case .default: return .default
|
case .default: return .default
|
||||||
|
case .contextMenu: return .image(Image(nsImage: NSCursor.contextualMenu.image), hotSpot: UnitPoint(x: 0, y: 0))
|
||||||
|
case .crosshair: return .rectSelection
|
||||||
case .grabIdle: return .grabIdle
|
case .grabIdle: return .grabIdle
|
||||||
case .grabActive: return .grabActive
|
case .grabActive: return .grabActive
|
||||||
case .horizontalText: return .horizontalText
|
case .horizontalText: return .horizontalText
|
||||||
|
Reference in New Issue
Block a user