summaryrefslogtreecommitdiff
path: root/app/src/widgets/participant_row.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-16 16:46:10 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-16 16:46:10 +0200
commitc6e430e13713eea51ecd00fa278f7fa635ad7272 (patch)
treee6eb407892ad5025fc1eb94d4e452cb7d8f00f17 /app/src/widgets/participant_row.cpp
parentc87ebdbfacdc2e1b5ae50286a5437e7b9eceafa7 (diff)
downloadturns-c6e430e13713eea51ecd00fa278f7fa635ad7272.tar.xz
turns-c6e430e13713eea51ecd00fa278f7fa635ad7272.zip
app: perform some code cleanup
Diffstat (limited to 'app/src/widgets/participant_row.cpp')
-rw-r--r--app/src/widgets/participant_row.cpp43
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");