diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-07-13 16:14:36 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-07-13 16:14:36 +0200 |
| commit | f8bfd268523ff5abd3cf5490d5b892ff49954f47 (patch) | |
| tree | 2af1079ec797c1617f1d88b43a847f7ce28cecdb /app | |
| parent | e4130ea27cc3a13780e95bd0654675336fa564ec (diff) | |
| download | turns-f8bfd268523ff5abd3cf5490d5b892ff49954f47.tar.xz turns-f8bfd268523ff5abd3cf5490d5b892ff49954f47.zip | |
app/ui: make list entry title editable
Diffstat (limited to 'app')
| -rw-r--r-- | app/include/turns/app/widgets/participant_list_row.hpp | 6 | ||||
| -rw-r--r-- | app/src/widgets/participant_list_row.cpp | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/app/include/turns/app/widgets/participant_list_row.hpp b/app/include/turns/app/widgets/participant_list_row.hpp index b9efbd6..172e9ac 100644 --- a/app/include/turns/app/widgets/participant_list_row.hpp +++ b/app/include/turns/app/widgets/participant_list_row.hpp @@ -7,15 +7,18 @@ #include <glibmm/ustring.h> #include <gtkmm/box.h> +#include <gtkmm/editablelabel.h> #include <gtkmm/image.h> #include <gtkmm/label.h> #include <gtkmm/listboxrow.h> +#include <gtkmm/togglebutton.h> namespace turns::app::widgets { struct participant_list_row : template_widget<participant_list_row, Gtk::ListBoxRow> { auto constexpr inline static children = std::array{ + "edit", "header", "prefixes", "image", @@ -31,12 +34,13 @@ namespace turns::app::widgets auto set_title(Glib::ustring const & value) -> void; private: + Gtk::ToggleButton * m_edit; Gtk::Box * m_header; Gtk::Image * m_image; Gtk::Box * m_prefixes; Gtk::Label * m_subtitle; Gtk::Box * m_suffixes; - Gtk::Label * m_title; + Gtk::EditableLabel * m_title; Gtk::Box * m_title_box; }; } // namespace turns::app::widgets diff --git a/app/src/widgets/participant_list_row.cpp b/app/src/widgets/participant_list_row.cpp index bc3108e..10bcc2d 100644 --- a/app/src/widgets/participant_list_row.cpp +++ b/app/src/widgets/participant_list_row.cpp @@ -14,13 +14,21 @@ namespace turns::app::widgets : Glib::ObjectBase(TYPE_NAME) , template_widget<participant_list_row, Gtk::ListBoxRow>{TEMPLATE} { + m_edit = get_widget<Gtk::ToggleButton>("edit"); m_header = get_widget<Gtk::Box>("header"); m_image = get_widget<Gtk::Image>("image"); m_prefixes = get_widget<Gtk::Box>("prefixes"); m_subtitle = get_widget<Gtk::Label>("subtitle"); m_suffixes = get_widget<Gtk::Box>("suffixes"); - m_title = get_widget<Gtk::Label>("title"); + m_title = get_widget<Gtk::EditableLabel>("title"); m_title_box = get_widget<Gtk::Box>("title_box"); + + m_edit->signal_clicked().connect([this]{ + if(m_edit->get_active()) + { + m_title->start_editing(); + } + }); } auto participant_list_row::set_subtitle(Glib::ustring const & value) -> void |
