(&mut self, col: u16, row: u16)
| 160 | } |
| 161 | |
| 162 | pub fn handle_click(&mut self, col: u16, row: u16) { |
| 163 | if !self.is_open { |
| 164 | return; |
| 165 | } |
| 166 | if let Some(area) = self.last_rendered_area.get() { |
| 167 | if row < area.y |
| 168 | || row >= area.y + area.height |
| 169 | || col < area.x |
| 170 | || col >= area.x + area.width |
| 171 | { |
| 172 | return; |
| 173 | } |
| 174 | // Options start at row area.y + 5 (border + title + blank + question + blank) |
| 175 | let options_start = area.y + 5; |
| 176 | if row >= options_start { |
| 177 | let idx = (row - options_start) as usize; |
| 178 | if let Some(q) = &self.current_question { |
| 179 | if idx < q.options.len() { |
| 180 | self.selected_index = idx; |
| 181 | self.toggle_selected(); |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | pub fn render(&self, frame: &mut Frame, area: Rect, theme: &Theme) { |
| 189 | if !self.is_open { |
nothing calls this directly
no test coverage detected