diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-29 17:03:31 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-29 17:03:31 +0200 |
| commit | 0afcbdc28f038b38d8cd7fe3d80191dc3bf31303 (patch) | |
| tree | 255f7e2c031b1c73a39c220e97ebd58be4379308 | |
| parent | 9233c81e68555be6e451e371eccc2914269dd08a (diff) | |
| download | turns-0afcbdc28f038b38d8cd7fe3d80191dc3bf31303.tar.xz turns-0afcbdc28f038b38d8cd7fe3d80191dc3bf31303.zip | |
ui: rename participant_row to ParticipantRow
| -rw-r--r-- | ui/include/turns/ui/participant_row.hpp | 4 | ||||
| -rw-r--r-- | ui/src/init.cpp | 2 | ||||
| -rw-r--r-- | ui/src/participant_row.cpp | 18 | ||||
| -rw-r--r-- | ui/src/participant_row.ui | 2 | ||||
| -rw-r--r-- | ui/src/turn_order_view.cpp | 2 | ||||
| -rw-r--r-- | ui/tests/participant_row.cpp | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/ui/include/turns/ui/participant_row.hpp b/ui/include/turns/ui/participant_row.hpp index dc72013..ed7b47c 100644 --- a/ui/include/turns/ui/participant_row.hpp +++ b/ui/include/turns/ui/participant_row.hpp @@ -17,7 +17,7 @@ namespace turns::ui { - struct participant_row : template_widget<participant_row, Gtk::ListBoxRow> + struct ParticipantRow : template_widget<ParticipantRow, Gtk::ListBoxRow> { auto constexpr inline static children = std::array{ "delete", @@ -27,7 +27,7 @@ namespace turns::ui "toggle_defeated", }; - participant_row(Glib::RefPtr<core::participant> participant); + ParticipantRow(Glib::RefPtr<core::participant> participant); auto delete_enabled() -> Glib::PropertyProxy<bool>; auto edit_enabled() -> Glib::PropertyProxy<bool>; diff --git a/ui/src/init.cpp b/ui/src/init.cpp index 73bd909..0e7e96d 100644 --- a/ui/src/init.cpp +++ b/ui/src/init.cpp @@ -11,7 +11,7 @@ namespace turns::ui auto register_types() -> void { static_cast<void>(ParticipantEditor{{}}); - static_cast<void>(participant_row{{}}); + static_cast<void>(ParticipantRow{{}}); static_cast<void>(preferences{{}}); static_cast<void>(turn_order_view{{}}); } diff --git a/ui/src/participant_row.cpp b/ui/src/participant_row.cpp index b6d18a8..e5075cd 100644 --- a/ui/src/participant_row.cpp +++ b/ui/src/participant_row.cpp @@ -28,7 +28,7 @@ namespace turns::ui { namespace { - auto constexpr static TYPE_NAME = "participant_row"; + auto constexpr static TYPE_NAME = "ParticipantRow"; auto constexpr static TEMPLATE = "/ch/arknet/Turns/participant_row.ui"; auto css_class_for(core::disposition value) -> Glib::ustring @@ -47,9 +47,9 @@ namespace turns::ui } } // namespace - participant_row::participant_row(Glib::RefPtr<core::participant> participant) + ParticipantRow::ParticipantRow(Glib::RefPtr<core::participant> participant) : Glib::ObjectBase(TYPE_NAME) - , template_widget<participant_row, Gtk::ListBoxRow>{TEMPLATE} + , template_widget{TEMPLATE} , m_delete{get_widget<Gtk::Button>("delete")} , m_edit{get_widget<Gtk::Button>("edit")} , m_subtitle{get_widget<Gtk::Label>("subtitle")} @@ -59,8 +59,8 @@ namespace turns::ui , m_edit_enabled{*this, "edit-enabled", true} { - 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_delete->signal_clicked().connect(sigc::mem_fun(*this, &ParticipantRow::handle_delete)); + m_edit->signal_clicked().connect(sigc::mem_fun(*this, &ParticipantRow::handle_edit)); Glib::Binding::bind_property(m_subtitle->property_label(), m_subtitle->property_visible(), @@ -124,23 +124,23 @@ namespace turns::ui } } - auto participant_row::delete_enabled() -> Glib::PropertyProxy<bool> + auto ParticipantRow::delete_enabled() -> Glib::PropertyProxy<bool> { return m_delete_enabled.get_proxy(); } - auto participant_row::edit_enabled() -> Glib::PropertyProxy<bool> + auto ParticipantRow::edit_enabled() -> Glib::PropertyProxy<bool> { return m_edit_enabled.get_proxy(); } - auto participant_row::handle_delete() -> void + auto ParticipantRow::handle_delete() -> void { auto index = Glib::Variant<int>::create(get_index()); activate_action("win.delete", index); } - auto participant_row::handle_edit() -> void + auto ParticipantRow::handle_edit() -> void { auto index = Glib::Variant<int>::create(get_index()); activate_action("win.edit", index); diff --git a/ui/src/participant_row.ui b/ui/src/participant_row.ui index 1a215c6..b53cc53 100644 --- a/ui/src/participant_row.ui +++ b/ui/src/participant_row.ui @@ -3,7 +3,7 @@ <interface> <!-- interface-name participant_row.ui --> <requires lib="gtk" version="4.18"/> - <template class="gtkmm__CustomObject_participant_row" parent="GtkListBoxRow"> + <template class="gtkmm__CustomObject_ParticipantRow" parent="GtkListBoxRow"> <property name="activatable">False</property> <property name="child"> <object class="GtkBox"> diff --git a/ui/src/turn_order_view.cpp b/ui/src/turn_order_view.cpp index 2ab8bba..51a0de8 100644 --- a/ui/src/turn_order_view.cpp +++ b/ui/src/turn_order_view.cpp @@ -48,7 +48,7 @@ namespace turns::ui auto turn_order_view::handle_create_row(Glib::RefPtr<Glib::Object> const item) -> Gtk::Widget * { auto participant = std::dynamic_pointer_cast<core::participant>(item); - auto row = Gtk::make_managed<participant_row>(participant); + auto row = Gtk::make_managed<ParticipantRow>(participant); Glib::Binding::bind_property(m_model->is_running(), row->delete_enabled(), diff --git a/ui/tests/participant_row.cpp b/ui/tests/participant_row.cpp index 5d89c42..920858b 100644 --- a/ui/tests/participant_row.cpp +++ b/ui/tests/participant_row.cpp @@ -18,12 +18,12 @@ namespace turns::ui::tests { SECTION("can be created without a participant") { - REQUIRE(std::make_shared<participant_row>(Glib::RefPtr<core::participant>{})); + REQUIRE(std::make_shared<ParticipantRow>(Glib::RefPtr<core::participant>{})); } SECTION("can be created with a participant") { - REQUIRE(std::make_shared<participant_row>(core::participant::create("Tazmyla Fireforge", 13, core::disposition::secret))); + REQUIRE(std::make_shared<ParticipantRow>(core::participant::create("Tazmyla Fireforge", 13, core::disposition::secret))); } } |
