From 605a730b597319a988d20268ddfacee1a2deae7c Mon Sep 17 00:00:00 2001 From: Green Sky Date: Tue, 23 Apr 2024 11:57:56 +0200 Subject: [PATCH] add status text to tooltip, contact as a single item (group) --- src/chat_gui/contact_list.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/chat_gui/contact_list.cpp b/src/chat_gui/contact_list.cpp index 4117c212..03348379 100644 --- a/src/chat_gui/contact_list.cpp +++ b/src/chat_gui/contact_list.cpp @@ -133,6 +133,7 @@ bool renderContactBig( const bool selectable, const bool selected ) { + ImGui::BeginGroup(); if (line_height < 1) { line_height = 1; } @@ -185,8 +186,18 @@ bool renderContactBig( ImGui::TextUnformatted("Connection state: unknown"); } - // TODO: add a whole bunch more info + if ( + const auto* slt = c.try_get(); + 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(); } @@ -297,6 +308,7 @@ bool renderContactBig( ImGui::SetCursorPos(post_curser_pos); + ImGui::EndGroup(); return got_selected; }