From 8de5772eb3acd5ba6e4380b2bcb7b5e829b3f9f4 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 13 Jul 2024 14:43:05 +0200 Subject: app/ui: add basic participant list row --- app/src/widgets/participant_list_row.cpp | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/src/widgets/participant_list_row.cpp (limited to 'app/src/widgets') diff --git a/app/src/widgets/participant_list_row.cpp b/app/src/widgets/participant_list_row.cpp new file mode 100644 index 0000000..bc3108e --- /dev/null +++ b/app/src/widgets/participant_list_row.cpp @@ -0,0 +1,38 @@ +#include "turns/app/widgets/participant_list_row.hpp" + +#include + +namespace turns::app::widgets +{ + namespace + { + auto constexpr static TYPE_NAME = "participant_list_row"; + auto constexpr static TEMPLATE = "/turns/widgets/participant_list_row.ui"; + } // namespace + + participant_list_row::participant_list_row() + : Glib::ObjectBase(TYPE_NAME) + , template_widget{TEMPLATE} + { + m_header = get_widget("header"); + m_image = get_widget("image"); + m_prefixes = get_widget("prefixes"); + m_subtitle = get_widget("subtitle"); + m_suffixes = get_widget("suffixes"); + m_title = get_widget("title"); + m_title_box = get_widget("title_box"); + } + + auto participant_list_row::set_subtitle(Glib::ustring const & value) -> void + { + m_subtitle->set_text(value); + m_subtitle->set_visible(!value.empty()); + } + + auto participant_list_row::set_title(Glib::ustring const & value) -> void + { + m_title->set_text(value); + m_title->set_visible(!value.empty()); + } + +} // namespace turns::app::widgets \ No newline at end of file -- cgit v1.2.3