Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

fix: result text in light mode #93

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion egui_node_graph_example/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,11 @@ impl eframe::App for NodeGraphExample {
egui::Align2::LEFT_TOP,
text,
TextStyle::Button.resolve(&ctx.style()),
egui::Color32::WHITE,
if ctx.style().visuals.dark_mode {
egui::Color32::WHITE
} else {
egui::Color32::BLACK
},
Comment on lines +451 to +455
Copy link
Contributor

@kamirr kamirr May 20, 2023

Choose a reason for hiding this comment

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

This may not work properly for an arbitrary style, only the default two. I think the right approach is using ctx.style().visuals.text_color().

);
} else {
self.user_state.active_node = None;
Expand Down