From f7fe1edcbbfde71d801379805b4605ff36075b11 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 28 Jul 2024 13:44:08 +0200 Subject: Improve ergonomics of `span` background highlighting --- widget/src/markdown.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'widget/src/markdown.rs') diff --git a/widget/src/markdown.rs b/widget/src/markdown.rs index 362aba67..cb3e9cfc 100644 --- a/widget/src/markdown.rs +++ b/widget/src/markdown.rs @@ -7,7 +7,6 @@ use crate::core::border; use crate::core::font::{self, Font}; use crate::core::padding; -use crate::core::text::Background; use crate::core::theme::{self, Theme}; use crate::core::{self, color, Color, Element, Length, Pixels}; use crate::{column, container, rich_text, row, scrollable, span, text}; @@ -262,10 +261,8 @@ pub fn parse<'a>( let span = span(code.into_string()) .font(Font::MONOSPACE) .color(Color::WHITE) - .background(Background { - color: color!(0x111111), - border: border::rounded(2), - }); + .background(color!(0x111111)) + .border(border::rounded(2)); let span = if let Some(link) = link.as_ref() { span.color(palette.primary).link(link.clone()) -- cgit