add status text to tooltip, contact as a single item (group)

This commit is contained in:
Green Sky 2024-04-23 11:57:56 +02:00
parent 3e15798afc
commit 605a730b59
No known key found for this signature in database

View File

@ -133,6 +133,7 @@ bool renderContactBig(
const bool selectable, const bool selectable,
const bool selected const bool selected
) { ) {
ImGui::BeginGroup();
if (line_height < 1) { if (line_height < 1) {
line_height = 1; line_height = 1;
} }
@ -185,8 +186,18 @@ bool renderContactBig(
ImGui::TextUnformatted("Connection state: unknown"); ImGui::TextUnformatted("Connection state: unknown");
} }
// TODO: add a whole bunch more info if (
const auto* slt = c.try_get<Contact::Components::StatusText>();
slt != nullptr &&
!slt->text.empty()
) {
ImGui::SeparatorText("Status Text");
//ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]);
ImGui::TextUnformatted(slt->text.c_str());
//ImGui::PopStyleColor();
}
// TODO: add a whole bunch more info
ImGui::EndTooltip(); ImGui::EndTooltip();
} }
@ -297,6 +308,7 @@ bool renderContactBig(
ImGui::SetCursorPos(post_curser_pos); ImGui::SetCursorPos(post_curser_pos);
ImGui::EndGroup();
return got_selected; return got_selected;
} }