From 527a542ff79c42da0d6a65a8a746a92eb5a7c5da Mon Sep 17 00:00:00 2001 From: Remigiusz Micielski Date: Thu, 5 Sep 2024 12:32:52 +0200 Subject: [PATCH] make it look better when searching --- rm-main/src/tui/tabs/torrents/rustmission_torrent.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rm-main/src/tui/tabs/torrents/rustmission_torrent.rs b/rm-main/src/tui/tabs/torrents/rustmission_torrent.rs index 86fc504..b72b659 100644 --- a/rm-main/src/tui/tabs/torrents/rustmission_torrent.rs +++ b/rm-main/src/tui/tabs/torrents/rustmission_torrent.rs @@ -100,7 +100,7 @@ impl RustmissionTorrent { let mut end = char_indices[end]; torrent_name_line.push_span(Span::styled( &self.torrent_name[last_end..start], - self.style(), + self.style, )); while !self.torrent_name.is_char_boundary(start) { @@ -155,7 +155,7 @@ impl RustmissionTorrent { flush_line(first, second); } - torrent_name_line.push_span(Span::styled(&self.torrent_name[last_end..], self.style())); + torrent_name_line.push_span(Span::styled(&self.torrent_name[last_end..], self.style)); let mut cells = vec![]; @@ -167,7 +167,11 @@ impl RustmissionTorrent { } } - Row::new(cells) + if self.is_selected { + Row::new(cells).reversed() + } else { + Row::new(cells) + } } fn style(&self) -> Style {