╭ changed ──────────╮ │src/ui/Settings.zig│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const ui = @import("../ui.zig"); │ │3 +const inp = @import("./input.zig");│ │4 const xit = @import("xit"); │ │5 const xitui = xit.xitui; │ │6 const wgt = xitui.widget; │ ╰──────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │106 switch (key) { │ │107 .enter => try self.toggle(), │ │108 .mouse => |mouse| { │ │108 - if (mouse.action == .press and mouse.action.press == .left) { │ │109 - if (root_focus.children.get(self.button_id)) |entry| { │ │110 - const r = entry.rect; │ │111 - if (mouse.x >= r.x and mouse.y >= r.y and │ │112 - mouse.x < r.x + r.size.width and mouse.y < r.y + r.size.height)│ │113 - { │ │114 - try self.toggle(); │ │115 - } │ │116 - } │ │109 + if (inp.leftClickOn(root_focus, self.button_id, mouse)) { │ │110 + try self.toggle(); │ │111 } │ │112 }, │ │113 else => {}, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯