Add text_color
helper for tab contents (#14737)
This PR adds a `text_color` method to `TabContentParams` to more easily compute the text color to be used for tab contents. This consolidates a number of conditionals that were scattered all over the place to give us a singular source of truth for these colors. Release Notes: - N/A
This commit is contained in:
parent
5d751f232c
commit
24d9374744
6 changed files with 35 additions and 60 deletions
|
@ -417,11 +417,7 @@ impl Item for ChannelView {
|
|||
.gap_2()
|
||||
.child(
|
||||
Label::new(channel_name)
|
||||
.color(if params.selected {
|
||||
Color::Default
|
||||
} else {
|
||||
Color::Muted
|
||||
})
|
||||
.color(params.text_color())
|
||||
.italic(params.preview),
|
||||
)
|
||||
.when_some(status, |element, status| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue