From 6dc510eb1732d69f1bbc91c3eaea5653ba31d042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20G=C3=B6rtler?= Date: Wed, 4 Dec 2024 17:16:51 +0100 Subject: [PATCH] Visually differentiate implicit nodes in graph view (#8313) ### What After refactoring, _implicit_ nodes were visualized using regular `text_color` and where therefore no possible to differentiate from regular nodes. This PR fixes that. image The node on the bottom (darker gray) is implicit. --- crates/viewer/re_space_view_graph/src/graph/mod.rs | 4 ++-- crates/viewer/re_space_view_graph/src/ui/draw.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/viewer/re_space_view_graph/src/graph/mod.rs b/crates/viewer/re_space_view_graph/src/graph/mod.rs index 8e6b29b7d47f..4ddb4c969087 100644 --- a/crates/viewer/re_space_view_graph/src/graph/mod.rs +++ b/crates/viewer/re_space_view_graph/src/graph/mod.rs @@ -114,7 +114,7 @@ impl Graph { nodes.push(Node::Implicit { id: edge.source_index, graph_node: edge.source.clone(), - label: DrawableLabel::implicit_circle(), + label: DrawableLabel::implicit_circle(ui), }); seen.insert(edge.source_index); } @@ -122,7 +122,7 @@ impl Graph { nodes.push(Node::Implicit { id: edge.target_index, graph_node: edge.target.clone(), - label: DrawableLabel::implicit_circle(), + label: DrawableLabel::implicit_circle(ui), }); seen.insert(edge.target_index); } diff --git a/crates/viewer/re_space_view_graph/src/ui/draw.rs b/crates/viewer/re_space_view_graph/src/ui/draw.rs index e8db060fda71..39440e4bc069 100644 --- a/crates/viewer/re_space_view_graph/src/ui/draw.rs +++ b/crates/viewer/re_space_view_graph/src/ui/draw.rs @@ -56,10 +56,10 @@ impl DrawableLabel { Self::Circle(CircleLabel { radius, color }) } - pub fn implicit_circle() -> Self { + pub fn implicit_circle(ui: &Ui) -> Self { Self::Circle(CircleLabel { radius: 4.0, - color: None, + color: Some(ui.style().visuals.weak_text_color()), }) }