diff options
Diffstat (limited to 'app/src/widgets')
| -rw-r--r-- | app/src/widgets/participant_row.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/app/src/widgets/participant_row.cpp b/app/src/widgets/participant_row.cpp index 4f55898..269aa15 100644 --- a/app/src/widgets/participant_row.cpp +++ b/app/src/widgets/participant_row.cpp @@ -41,37 +41,36 @@ namespace turns::app::widgets , m_subtitle{get_widget<Gtk::Label>("subtitle")} , m_title{get_widget<Gtk::Label>("title")} , m_toggle_defeated{get_widget<Gtk::ToggleButton>("toggle_defeated")} - , m_subtitle_visibility{} { m_delete->signal_clicked().connect(sigc::mem_fun(*this, &participant_row::handle_delete)); m_edit->signal_clicked().connect(sigc::mem_fun(*this, &participant_row::handle_edit)); - m_subtitle_visibility = Glib::Binding::bind_property(m_subtitle->property_label(), - m_subtitle->property_visible(), - Glib::Binding::Flags::DEFAULT, - sigc::mem_fun(&Glib::ustring::size)); - m_title_visibility = Glib::Binding::bind_property(m_title->property_label(), - m_title->property_visible(), - Glib::Binding::Flags::INVERT_BOOLEAN, - sigc::mem_fun(&Glib::ustring::size)); - m_toggle_defeated_icon = Glib::Binding::bind_property(m_toggle_defeated->property_active(), - m_toggle_defeated->property_icon_name(), - Glib::Binding::Flags::SYNC_CREATE, - [](auto active) { return active ? "face-sick-symbolic" : "face-smile-symbolic"; }); + Glib::Binding::bind_property(m_subtitle->property_label(), + m_subtitle->property_visible(), + Glib::Binding::Flags::DEFAULT, + sigc::mem_fun(&Glib::ustring::size)); + Glib::Binding::bind_property(m_title->property_label(), + m_title->property_visible(), + Glib::Binding::Flags::INVERT_BOOLEAN, + sigc::mem_fun(&Glib::ustring::size)); + Glib::Binding::bind_property(m_toggle_defeated->property_active(), + m_toggle_defeated->property_icon_name(), + Glib::Binding::Flags::SYNC_CREATE, + [](auto active) { return active ? "face-sick-symbolic" : "face-smile-symbolic"; }); if (participant) { - m_title_label = Glib::Binding::bind_property(participant->property_name(), m_title->property_label(), Glib::Binding::Flags::SYNC_CREATE); + Glib::Binding::bind_property(participant->property_name(), m_title->property_label(), Glib::Binding::Flags::SYNC_CREATE); - 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)); }); + 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)); }); - m_toggle_defeated_css_classes = Glib::Binding::bind_property(participant->property_disposition(), - m_toggle_defeated->property_css_classes(), - Glib::Binding::Flags::SYNC_CREATE, - [this](auto value) { + Glib::Binding::bind_property(participant->property_disposition(), + m_toggle_defeated->property_css_classes(), + Glib::Binding::Flags::SYNC_CREATE, + [this](auto value) { auto classes = m_toggle_defeated->get_css_classes(); auto removed = std::ranges::remove_if(classes, [](auto cls) { return (cls == "disposition-friendly") | (cls == "disposition-hostile") || (cls == "disposition-secret"); |
