From a23cda29f0acef40d883c37209389c956c14e83b Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 15 Jul 2024 16:00:29 +0200 Subject: turns: perform widespread code cleanup actions --- app/include/turns/app/application.hpp | 12 ++++++------ app/include/turns/app/widgets/participant_list_row.hpp | 11 +++++++++-- app/include/turns/app/windows/main.hpp | 12 ++++++++---- app/include/turns/app/windows/participant_editor.hpp | 7 +++---- 4 files changed, 26 insertions(+), 16 deletions(-) (limited to 'app/include/turns') diff --git a/app/include/turns/app/application.hpp b/app/include/turns/app/application.hpp index c74f340..81fe333 100644 --- a/app/include/turns/app/application.hpp +++ b/app/include/turns/app/application.hpp @@ -1,13 +1,13 @@ #ifndef TURNS_APP_APPLICATION_HPP #define TURNS_APP_APPLICATION_HPP -#include +#include "turns/app/windows/main.hpp" + +#include +#include #include #include -#include - -#include namespace turns::app { @@ -27,9 +27,9 @@ namespace turns::app auto on_shutdown() -> void; auto on_startup() -> void; - AdwApplication * m_self; + AdwApplication * m_adw; Glib::RefPtr m_application; - AdwApplicationWindow * m_main_window; + windows::main * m_main; }; } // namespace turns::app diff --git a/app/include/turns/app/widgets/participant_list_row.hpp b/app/include/turns/app/widgets/participant_list_row.hpp index 2e3b176..6a9a6c2 100644 --- a/app/include/turns/app/widgets/participant_list_row.hpp +++ b/app/include/turns/app/widgets/participant_list_row.hpp @@ -2,9 +2,12 @@ #define TURNS_APP_WIDGETS_PARTICIPANT_LIST_ROW_HPP #include "turns/app/widgets/template_widget.hpp" +#include "turns/domain/participant.hpp" #include +#include +#include #include #include #include @@ -23,20 +26,24 @@ namespace turns::app::widgets "toggle_defeated", }; - participant_list_row(); + participant_list_row(Glib::RefPtr participant); auto set_subtitle(Glib::ustring const & value) -> void; auto set_title(Glib::ustring const & value) -> void; private: auto handle_delete() -> void; - auto handle_toggle_defeated() -> void; + auto handle_edit() -> void; Gtk::Button * m_delete; Gtk::Button * m_edit; Gtk::Label * m_subtitle; Gtk::Label * m_title; Gtk::ToggleButton * m_toggle_defeated; + + Glib::RefPtr m_subtitle_visibility{}; + Glib::RefPtr m_title_visibility{}; + Glib::RefPtr m_toggle_defeated_icon{}; }; } // namespace turns::app::widgets diff --git a/app/include/turns/app/windows/main.hpp b/app/include/turns/app/windows/main.hpp index 22dab74..ca8237c 100644 --- a/app/include/turns/app/windows/main.hpp +++ b/app/include/turns/app/windows/main.hpp @@ -4,15 +4,14 @@ #include "turns/domain/turn_order.hpp" #include -#include +#include #include #include +#include #include #include #include -#include #include -#include #include #include #include @@ -36,7 +35,12 @@ namespace turns::app::windows AdwWindowTitle * m_title; Gtk::ScrolledWindow * m_turn_order; - Glib::RefPtr m_participants; + Glib::RefPtr m_participant_list_data; + + Glib::PropertyProxy m_subtitle; + + Glib::RefPtr m_visible_child_widget{}; + Glib::RefPtr m_subtitle_text{}; }; } // namespace turns::app::windows diff --git a/app/include/turns/app/windows/participant_editor.hpp b/app/include/turns/app/windows/participant_editor.hpp index 0d7b518..38b1887 100644 --- a/app/include/turns/app/windows/participant_editor.hpp +++ b/app/include/turns/app/windows/participant_editor.hpp @@ -30,14 +30,13 @@ namespace turns::app::windows auto handle_finish_clicked() -> void; AdwDialog * m_adw; - Gtk::Button * m_finish; - - Glib::RefPtr m_participant; - AdwComboRow * m_disposition{}; + Gtk::Button * m_finish; AdwEntryRow * m_name{}; AdwSpinRow * m_priority{}; + Glib::RefPtr m_participant; + signal_finished_type m_signal_finished{}; }; -- cgit v1.2.3