diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-07-23 15:08:19 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-07-23 15:08:19 +0200 |
| commit | 4ec6a2ae12b6adb843c0777649ff45a741ca6cbc (patch) | |
| tree | 93dc2ba99dbcb42b2af73f0a3c4cd4f0c0f091c4 /app/src/widgets/participant_row.cpp | |
| parent | 5f4249a37ce816b8deceb299bc841190fbb15983 (diff) | |
| download | turns-4ec6a2ae12b6adb843c0777649ff45a741ca6cbc.tar.xz turns-4ec6a2ae12b6adb843c0777649ff45a741ca6cbc.zip | |
domain: redesign turn_order
Diffstat (limited to 'app/src/widgets/participant_row.cpp')
| -rw-r--r-- | app/src/widgets/participant_row.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/app/src/widgets/participant_row.cpp b/app/src/widgets/participant_row.cpp index 3494834..87cc217 100644 --- a/app/src/widgets/participant_row.cpp +++ b/app/src/widgets/participant_row.cpp @@ -73,14 +73,14 @@ namespace turns::app::widgets if (participant) { - Glib::Binding::bind_property(participant->property_name(), m_title->property_label(), Glib::Binding::Flags::SYNC_CREATE); + Glib::Binding::bind_property(participant->name(), m_title->property_label(), Glib::Binding::Flags::SYNC_CREATE); - Glib::Binding::bind_property(participant->property_priority(), + Glib::Binding::bind_property(participant->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_disposition(), + Glib::Binding::bind_property(participant->disposition(), m_toggle_defeated->property_css_classes(), Glib::Binding::Flags::SYNC_CREATE, [this](auto value) { @@ -92,6 +92,19 @@ namespace turns::app::widgets classes.push_back(css_class_for(value)); return classes; }); + + Glib::Binding::bind_property(participant->is_active(), property_css_classes(), Glib::Binding::Flags::SYNC_CREATE, [this](auto value) { + auto classes = get_css_classes(); + if (!value) + { + std::erase(classes, "active-participant"); + } + else + { + classes.push_back("active-participant"); + } + return classes; + }); } } |
