(&self, frame: &mut Frame, area: Rect, state: &mut SidebarState, floating: bool)
| 158 | } |
| 159 | |
| 160 | pub fn render(&self, frame: &mut Frame, area: Rect, state: &mut SidebarState, floating: bool) { |
| 161 | if area.width == 0 || area.height == 0 { |
| 162 | state.reset_hidden(); |
| 163 | return; |
| 164 | } |
| 165 | |
| 166 | state.set_sidebar_area(area); |
| 167 | let theme = self.context.theme.read().clone(); |
| 168 | |
| 169 | if !floating { |
| 170 | let block = Block::default() |
| 171 | .borders(Borders::NONE) |
| 172 | .style(Style::default().bg(theme.background_panel)); |
| 173 | frame.render_widget(block, area); |
| 174 | } |
| 175 | |
| 176 | let inner = Rect { |
| 177 | x: area.x.saturating_add(2), |
| 178 | y: area.y.saturating_add(1), |
| 179 | width: area.width.saturating_sub(4), |
| 180 | height: area.height.saturating_sub(2), |
| 181 | }; |
| 182 | if inner.width == 0 || inner.height == 0 { |
| 183 | state.reset_hidden(); |
| 184 | return; |
| 185 | } |
| 186 | |
| 187 | let layout = Layout::default() |
| 188 | .direction(Direction::Vertical) |
| 189 | .constraints([Constraint::Min(0), Constraint::Length(3)]) |
| 190 | .split(inner); |
| 191 | |
| 192 | self.render_sections(frame, layout[0], &theme, state, floating); |
| 193 | self.render_footer(frame, layout[1], &theme, floating); |
| 194 | } |
| 195 | |
| 196 | fn render_sections( |
| 197 | &self, |
nothing calls this directly
no test coverage detected