diff options
author | Tim Oram <dev@mitmaro.ca> | 2024-03-07 09:35:21 -0330 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2024-03-08 08:58:25 -0330 |
commit | b2f058479f4331f8cc2fca1b63440876154c10d2 (patch) | |
tree | d974effbd6b9dda32f2d095981127d14bfcb9c04 /src/view/view_line.rs | |
parent | ea756cf3529705c1af3b26d42090f227a902e77c (diff) |
Move LineSegment styles to bitflags Struct
Diffstat (limited to 'src/view/view_line.rs')
-rw-r--r-- | src/view/view_line.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/view/view_line.rs b/src/view/view_line.rs index c8e9761..c9f2e61 100644 --- a/src/view/view_line.rs +++ b/src/view/view_line.rs @@ -1,4 +1,7 @@ -use crate::{display::DisplayColor, view::LineSegment}; +use crate::{ + display::DisplayColor, + view::{LineSegment, LineSegmentOptions}, +}; /// Represents a line in the view. #[derive(Debug)] @@ -54,16 +57,12 @@ impl ViewLine { mut self, c: char, color: DisplayColor, - dim: bool, - underline: bool, - reverse: bool, + options: LineSegmentOptions, ) -> Self { self.padding = Some(LineSegment::new_with_color_and_style( String::from(c).as_str(), color, - dim, - underline, - reverse, + options, )); self } @@ -202,8 +201,11 @@ mod tests { #[test] fn set_padding_with_color_and_style() { - let view_line = - ViewLine::from("foo").set_padding_with_color_and_style(' ', DisplayColor::IndicatorColor, true, true, true); + let view_line = ViewLine::from("foo").set_padding_with_color_and_style( + ' ', + DisplayColor::IndicatorColor, + LineSegmentOptions::all(), + ); let padding = view_line.get_padding().as_ref().unwrap(); assert_eq!(padding.get_content(), " "); |