Show message when no links were found

This commit is contained in:
Joscha 2022-08-30 02:32:08 +02:00
parent 8846234d8d
commit 7932c2f20b

View file

@ -38,6 +38,12 @@ impl LinksState {
pub fn widget(&self) -> BoxedWidget { pub fn widget(&self) -> BoxedWidget {
let mut list = self.list.widget().focus(true); let mut list = self.list.widget().focus(true);
if self.links.is_empty() {
list.add_unsel(Text::new((
"No links found",
ContentStyle::default().grey().italic(),
)))
}
for (id, link) in self.links.iter().enumerate() { for (id, link) in self.links.iter().enumerate() {
list.add_sel( list.add_sel(
id, id,