fix: scrollbar hover effect

This commit is contained in:
CJ van den Berg 2026-01-16 10:30:30 +01:00
parent 67a6d01291
commit 548410f769
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -65,6 +65,7 @@ pub fn handle_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result {
pub fn receive(self: *Self, _: tp.pid_ref, m: tp.message) error{Exit}!bool {
var y: i32 = undefined;
var ypx: i32 = undefined;
const old_hover = self.hover;
if (try m.match(.{ "B", input.event.press, @intFromEnum(input.mouse.BUTTON1), tp.any, tp.any, tp.extract(&y), tp.any, tp.extract(&ypx) })) {
self.active = true;
@ -86,6 +87,8 @@ pub fn receive(self: *Self, _: tp.pid_ref, m: tp.message) error{Exit}!bool {
self.active = false;
return true;
} else if (try m.match(.{ "H", tp.extract(&self.hover) })) {
if (old_hover != self.hover)
tui.need_render(@src());
return true;
}