Skip to content

Add background styling to span / rich text#2516

Merged
hecrj merged 7 commits intoiced-rs:masterfrom
tarkah:feat/span-background
Jul 28, 2024
Merged

Add background styling to span / rich text#2516
hecrj merged 7 commits intoiced-rs:masterfrom
tarkah:feat/span-background

Conversation

@tarkah
Copy link
Member

@tarkah tarkah commented Jul 23, 2024

Adds a new text::Background type which can be optionally specified on Span.

rich_text will use this to render background quads for spans where this is set.

A new Paragraph::span_bounds method is added to get the bounds of each span to enabled this.

simplescreenrecorder-2024-07-23_13.37.52.mp4

I'm using this in Halloy:

image

@tarkah tarkah force-pushed the feat/span-background branch 4 times, most recently from 1feb29a to f70edc2 Compare July 24, 2024 00:01
Copy link
Member

@derezzedex derezzedex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could improve the creation of the text::Background with a few helpers, and also possibly changing it to span::Background.
But looks pretty good overall!

@hecrj hecrj added this to the 0.13 milestone Jul 27, 2024
@hecrj hecrj force-pushed the feat/span-background branch from f70edc2 to 4dc7b9b Compare July 28, 2024 11:18
@hecrj hecrj force-pushed the feat/span-background branch from f257b0b to 2796a6b Compare July 28, 2024 11:58
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified some stuff here and there, but looks great! 🥳

@hecrj hecrj merged commit c47a6ed into iced-rs:master Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments