voelin-gpui: a channel's banner is drawn under the surface veil, as the Slint tree's

A channel row drew its banner picture at full strength under the name, so
Theme.text could sit on a picture of its own colour (dark text on the sample
server's dark banners in the light theme, light text on a bright TS6 banner in
the dark one). banner-picture.slint lays the surface colour over the picture,
74 % opaque on the left and 66 % on the right; the row now does the same, over
the picture and under the tint of our own channel.

A test keeps the veil: the text of both themes has more than 4.5 to 1 against
the weakest end over a black and over a white picture, and the gradient is the
surface colour at those two opacities; another finds the veil on the sample
server's banner rows and on no other.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-28 03:48:31 +03:00
1 parent 0e01b60930
commit f8cf6a3561
3 files changed
+93 -4

No files matched your search

+15 -2
View File
@@ -29,7 +29,7 @@ use super::actions::{
EditChannel, JoinChannel, MoveClient, OpenClient, OpenMember, SelectChannel, ToggleChannel,
};
use super::tree_model::{Emptiness, TreeEvent, TreeModel};
use super::widgets::{Avatar, icon, live_badge, small_picture};
use super::widgets::{Avatar, banner_scrim, icon, live_badge, small_picture};
use crate::meter::Counters;
use crate::pictures::{PictureKey, picture};
use crate::theme::{VoelinTheme, hsla};
@@ -215,7 +215,9 @@ fn channel_row(theme: &VoelinTheme, item: &TreeItem, selected: bool) -> AnyEleme
.when(own, |row| row.bg(accent_soft).border_1().border_color(accent))
.when(!own && selected, |row| row.bg(selected_fill))
.when(!own && !selected, |row| row.hover(move |style| style.bg(hover)))
// Artwork behind the same compact row as its title, from the indent on.
// Artwork behind the same compact row as its title, from the indent on,
// under a veil of the surface colour that keeps the text readable over
// any picture, and under the tint of our own channel.
.when_some(banner, |row, key| {
row.child(
div()
@@ -226,6 +228,17 @@ fn channel_row(theme: &VoelinTheme, item: &TreeItem, selected: bool) -> AnyEleme
.right(px(0.0))
.child(picture(key).size_full().object_fit(ObjectFit::Cover)),
)
.child(
div()
.id(("tree-scrim", id))
.debug_selector(move || format!("tree-scrim-{id}"))
.absolute()
.top(px(0.0))
.bottom(px(0.0))
.left(px(indent))
.right(px(0.0))
.bg(banner_scrim(theme)),
)
.when(own, |row| {
row.child(
div()