ratatui_toolkit/widgets/markdown_widget/extensions/toc/constructors/
viewport.rs

1//! Viewport configuration for Toc widget.
2
3use crate::widgets::markdown_widget::extensions::toc::Toc;
4
5impl<'a> Toc<'a> {
6    /// Set the current viewport information.
7    ///
8    /// # Arguments
9    ///
10    /// * `scroll_offset` - Current scroll offset.
11    /// * `viewport_height` - Height of the visible viewport.
12    /// * `total_lines` - Total number of lines in the document.
13    ///
14    /// # Returns
15    ///
16    /// Self for method chaining.
17    pub fn viewport(
18        self,
19        _scroll_offset: usize,
20        _viewport_height: usize,
21        _total_lines: usize,
22    ) -> Self {
23        // These are now managed by TocState, this is a no-op for compatibility
24        self
25    }
26
27    /// Set the TOC scroll offset (for scrolling within the TOC list).
28    ///
29    /// # Arguments
30    ///
31    /// * `offset` - The scroll offset for the TOC list.
32    ///
33    /// # Returns
34    ///
35    /// Self for method chaining.
36    pub fn toc_scroll(self, _offset: usize) -> Self {
37        // Now managed by TocState, this is a no-op for compatibility
38        self
39    }
40}