From 089a615adb401f1b91fd0fc7138aa65f2abd769b Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 5 Jul 2021 18:00:21 +0200 Subject: [PATCH] pgui: If no explicit candidate_inactive style given, use underscore --- panda/src/pgui/pgEntry.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/panda/src/pgui/pgEntry.cxx b/panda/src/pgui/pgEntry.cxx index d3fcad98fc..2fc40d546a 100644 --- a/panda/src/pgui/pgEntry.cxx +++ b/panda/src/pgui/pgEntry.cxx @@ -794,9 +794,16 @@ update_text() { } else { TextPropertiesManager *tp_mgr = TextPropertiesManager::get_global_ptr(); + bool has_inactive = tp_mgr->has_properties(_candidate_inactive); TextProperties inactive = tp_mgr->get_properties(_candidate_inactive); TextProperties active = tp_mgr->get_properties(_candidate_active); + if (!has_inactive) { + // Just underscoring the candidate is a sensible default. + inactive.set_underscore(true); + tp_mgr->set_properties(_candidate_inactive, inactive); + } + // Insert the complex sequence of characters required to show the // candidate string in a different color. This gets inserted at the // current cursor position.