mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-30 18:27:00 +01:00
review: Replies cards fill with surface.chrome, the selected one with the selection fill
surface.control is the panel's white where controls are distinct, so the cards showed no tile. Production filled its cards with its chrome colour and its selected card with its selection colour under the accent outline; the inline card now takes surface.chrome and state.selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6275c18fad
commit
ef130e8e6d
1 file changed
+7
-4
@@ -40,8 +40,9 @@ pub(crate) struct CommentRowStyle {
|
||||
/// The author's face on an inline card, and its initials.
|
||||
face: StyleColor,
|
||||
face_ink: StyleColor,
|
||||
/// The soft fill and corners of an inline card's surface.
|
||||
/// The soft fill, selected fill and corners of an inline card's surface.
|
||||
tile: StyleColor,
|
||||
tile_selected: StyleColor,
|
||||
corners: CornerRadius,
|
||||
/// The line that joins a card's avatars.
|
||||
thread_line: StyleColor,
|
||||
@@ -930,7 +931,8 @@ impl Component for CommentRow<'_> {
|
||||
avatar_ink: cx.color(color.text.normal),
|
||||
face: cx.color(color.accent.strong),
|
||||
face_ink: cx.color(color.text.on_strong),
|
||||
tile: cx.color(color.surface.control),
|
||||
tile: cx.color(color.surface.chrome),
|
||||
tile_selected: cx.color(color.state.selected),
|
||||
corners: UiTokens::corner(cx.tokens.shape.radius.surface),
|
||||
thread_line: cx.color(color.line.divider),
|
||||
kind_icon: cx.tokens.size.icon.sm,
|
||||
@@ -994,10 +996,11 @@ impl Component for CommentRow<'_> {
|
||||
ui.draw().fill(&shape, st.card);
|
||||
ui.draw().stroke(&shape, StrokeWidth::Thin, st.border);
|
||||
}
|
||||
// An inline card is a filled surface above the gap to the next card; the selected one is outlined in the accent.
|
||||
// An inline card is a chrome-filled tile above the gap to the next card; the selected one takes the selection
|
||||
// fill, outlined in the accent.
|
||||
if self.actions == CardActions::Inline && self.thread.is_some() {
|
||||
let surface = PaintShape::Rect(Rect::from_min_max(rect.min, Pos2::new(rect.max.x, rect.max.y - st.gap)), st.corners);
|
||||
ui.draw().fill(&surface, st.tile);
|
||||
ui.draw().fill(&surface, if self.selected { st.tile_selected } else { st.tile });
|
||||
if self.selected {
|
||||
ui.draw().stroke(&surface, StrokeWidth::Medium, st.bar);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user