From 44d2614a260d2b029a79c59ee7fdd45e1958feb8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 16 Jul 2024 13:02:46 +0200 Subject: app: extract turn order view --- app/src/widgets/participant_row.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'app/src/widgets/participant_row.cpp') diff --git a/app/src/widgets/participant_row.cpp b/app/src/widgets/participant_row.cpp index 9e0419a..75321e5 100644 --- a/app/src/widgets/participant_row.cpp +++ b/app/src/widgets/participant_row.cpp @@ -45,22 +45,14 @@ namespace turns::app::widgets if (participant) { - set_title(participant->get_name()); - auto priority = participant->get_priority(); - set_subtitle(std::vformat(_(lang::priority_number), std::make_format_args(priority))); - } - } - - auto participant_row::set_subtitle(Glib::ustring const & value) -> void - { - m_subtitle->property_label() = value; - } + m_title_label = Glib::Binding::bind_property(participant->property_name(), m_title->property_label(), Glib::Binding::Flags::SYNC_CREATE); - auto participant_row::set_title(Glib::ustring const & value) -> void - { - m_title->property_label() = value; + m_subtitle_label = Glib::Binding::bind_property(participant->property_priority(), + m_subtitle->property_label(), + Glib::Binding::Flags::SYNC_CREATE, + [](auto n) { return std::vformat(_(lang::priority_number), std::make_format_args(n)); }); + } } - auto participant_row::handle_delete() -> void { auto index = Glib::Variant::create(get_index()); -- cgit v1.2.3