MCPcopy Create free account
hub / github.com/GCWing/BitFun / captures_mouse

Method captures_mouse

src/apps/cli/src/ui/command_menu.rs:212–224  ·  view source on GitHub ↗

Whether the menu captures this mouse event (prevents passthrough)

(&self, mouse: &MouseEvent)

Source from the content-addressed store, hash-verified

210
211 /// Whether the menu captures this mouse event (prevents passthrough)
212 pub fn captures_mouse(&self, mouse: &MouseEvent) -> bool {
213 if !self.visible {
214 return false;
215 }
216 let Some(area) = self.last_area else {
217 return false;
218 };
219 let in_menu = mouse.column >= area.x
220 && mouse.column < area.x.saturating_add(area.width)
221 && mouse.row >= area.y
222 && mouse.row < area.y.saturating_add(area.height);
223 in_menu
224 }
225
226 fn selected_item(&self) -> Option<&CommandSpec> {
227 let idx = self.list_state.selected().unwrap_or(0);

Calls

no outgoing calls

Tested by

no test coverage detected