diff --git a/src/ui/room.rs b/src/ui/room.rs index adb674c..57dfb10 100644 --- a/src/ui/room.rs +++ b/src/ui/room.rs @@ -95,7 +95,7 @@ impl EuphRoom { State::Normal => chat, State::ChooseNick(ed) => Layer::new(vec![ chat, - Float::new(Border::new( + Float::new(Border::new(Background::new( Padding::new(VJoin::new(vec![ Segment::new(Text::new("Choose nick ")), Segment::new( @@ -104,7 +104,7 @@ impl EuphRoom { ), ])) .left(1), - )) + ))) .horizontal(0.5) .vertical(0.5) .into(), @@ -207,7 +207,7 @@ impl EuphRoom { list.add_sel( id, Text::new(normal), - Background::new(Text::new(selected), style_inv), + Background::new(Text::new(selected)).style(style_inv), ); } diff --git a/src/ui/rooms.rs b/src/ui/rooms.rs index 6aa679e..54cafe7 100644 --- a/src/ui/rooms.rs +++ b/src/ui/rooms.rs @@ -102,7 +102,7 @@ impl Rooms { let room_style = ContentStyle::default().bold().blue(); Layer::new(vec![ self.rooms_widget().await, - Float::new(Border::new( + Float::new(Border::new(Background::new( Padding::new(VJoin::new(vec![ Segment::new(Text::new("Connect to ")), Segment::new(HJoin::new(vec![ @@ -113,7 +113,7 @@ impl Rooms { ])), ])) .left(1), - )) + ))) .horizontal(0.5) .vertical(0.5) .into(), @@ -188,7 +188,7 @@ impl Rooms { list.add_sel( room, Text::new(normal), - Background::new(Text::new(selected), bg_sel_style), + Background::new(Text::new(selected)).style(bg_sel_style), ); } } diff --git a/src/ui/widgets/background.rs b/src/ui/widgets/background.rs index bcc03f4..4990bcf 100644 --- a/src/ui/widgets/background.rs +++ b/src/ui/widgets/background.rs @@ -10,12 +10,17 @@ pub struct Background { } impl Background { - pub fn new>(inner: W, style: ContentStyle) -> Self { + pub fn new>(inner: W) -> Self { Self { inner: inner.into(), - style, + style: ContentStyle::default(), } } + + pub fn style(mut self, style: ContentStyle) -> Self { + self.style = style; + self + } } #[async_trait]