Whether the menu captures this mouse event (prevents passthrough)
(&self, mouse: &MouseEvent)
| 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); |
no outgoing calls
no test coverage detected