#[derive(Debug, Clone)]
pub struct TxtViewConfig {
pub show_line_numbers: bool,
pub show_help_bar: bool,
pub show_scrollbar: bool,
pub viewport_width: Option<u16>,
pub viewport_height: Option<u16>,
}
impl Default for TxtViewConfig {
fn default() -> Self {
TxtViewConfig {
show_line_numbers: false,
show_help_bar: true,
show_scrollbar: true,
viewport_width: None,
viewport_height: None,
}
}
}
impl TxtViewConfig {
#[must_use]
pub fn with_show_line_numbers(mut self, show: bool) -> Self {
self.show_line_numbers = show;
self
}
#[must_use]
pub fn with_show_help_bar(mut self, show: bool) -> Self {
self.show_help_bar = show;
self
}
#[must_use]
pub fn with_show_scrollbar(mut self, show: bool) -> Self {
self.show_scrollbar = show;
self
}
#[must_use]
pub fn with_viewport_width(mut self, width: Option<u16>) -> Self {
self.viewport_width = width;
self
}
#[must_use]
pub fn with_viewport_height(mut self, height: Option<u16>) -> Self {
self.viewport_height = height;
self
}
}