module Obsctl::TUI::HitTest

Overview

Resolves screen coordinates to the panel and row underneath them.

The dashboard is drawn from a pure layout function and lists whose scroll offset is derived, not stored, so the same inputs that produced a frame can be replayed to ask what is at a point. Nothing about the last render has to be cached.

Extended Modules

Defined in:

obsctl/tui/hit_test.cr

Constant Summary

MUTE_CONTROL_WIDTH = 3

Columns the mute glyph and its trailing space occupy at the start of an audio row, matching the leading span in Widgets::Audio.

Instance Method Summary

Instance Method Detail

def palette_area(model : Model, area : CryTUI::Rect) : CryTUI::Rect #

The panel the command palette is drawn in, so a click outside it can be told from a click on it.


[View source]
def palette_completion(model : Model, area : CryTUI::Rect, column : Int32, row : Int32) : Int32 | Nil #

The completion chip under the pointer, or nil anywhere else.


[View source]
def resolve(model : Model, area : CryTUI::Rect, column : Int32, row : Int32) : PointerTarget | Nil #

[View source]
def settings_index(model : Model, area : CryTUI::Rect, column : Int32, row : Int32) : Int32 | Nil #

The theme row under the pointer in the appearance lab.


[View source]
def which_key_area(model : Model, area : CryTUI::Rect) : CryTUI::Rect #

Where the which-key menu is drawn for the sequence being typed.


[View source]
def which_key_entry(model : Model, area : CryTUI::Rect, column : Int32, row : Int32) : Keymap::Entry | Nil #

The which-key row under the pointer, so the menu can be clicked as well as typed.


[View source]