mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 22:14:53 +02:00
Use correct pointer shape for hyperlinks
This commit is contained in:
@@ -493,6 +493,8 @@ func (self *Loop) PopPointerShape() {
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all pointer shapes from the shape stack resetting to default pointer
|
||||
// shape. This is called automatically on loop termination.
|
||||
func (self *Loop) ClearPointerShapes() (ans []PointerShape) {
|
||||
ans = self.pointer_shapes
|
||||
for i := len(self.pointer_shapes) - 1; i >= 0; i-- {
|
||||
|
||||
@@ -289,11 +289,20 @@ func (m *MouseState) ApplyHoverStyles(lp *loop.Loop, style ...string) {
|
||||
} else {
|
||||
hs = style[0]
|
||||
}
|
||||
is_hovered := false
|
||||
for id := range m.hovered_ids.Iterable() {
|
||||
for _, r := range m.region_id_map[id] {
|
||||
lp.StyleRegion(hs, r.TopLeft.X, r.TopLeft.Y, r.BottomRight.X, r.BottomRight.Y)
|
||||
is_hovered = true
|
||||
}
|
||||
}
|
||||
if is_hovered {
|
||||
if s, has := lp.CurrentPointerShape(); !has || s != loop.POINTER_POINTER {
|
||||
lp.PushPointerShape(loop.POINTER_POINTER)
|
||||
}
|
||||
} else {
|
||||
lp.ClearPointerShapes()
|
||||
}
|
||||
}
|
||||
|
||||
func (m *MouseState) ClickHoveredRegions() error {
|
||||
|
||||
Reference in New Issue
Block a user