diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-06-04 02:39:35 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-06-04 02:39:35 -0400 |
commit | 43ea62d444b41e9ffff785ede2620b2e64fbb3b7 (patch) | |
tree | 95ccd96da8a15a4ce6586b8a065277770999087a /windows/profile/userinfopane.cpp | |
parent | 79c00c68e5845b496f6d3163d6fbc6e1c6de56ae (diff) | |
parent | 28b33d1b220aef5558ef58eb1326510ccccf5361 (diff) | |
download | abaddon-portaudio-43ea62d444b41e9ffff785ede2620b2e64fbb3b7.tar.gz abaddon-portaudio-43ea62d444b41e9ffff785ede2620b2e64fbb3b7.zip |
merge
Diffstat (limited to 'windows/profile/userinfopane.cpp')
-rw-r--r-- | windows/profile/userinfopane.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/windows/profile/userinfopane.cpp b/windows/profile/userinfopane.cpp index 384f62c..e9309d6 100644 --- a/windows/profile/userinfopane.cpp +++ b/windows/profile/userinfopane.cpp @@ -158,6 +158,25 @@ NotesContainer::type_signal_update_note NotesContainer::signal_update_note() { return m_signal_update_note; } +BioContainer::BioContainer() + : Gtk::Box(Gtk::ORIENTATION_VERTICAL) { + m_label.set_markup("<b>ABOUT ME</b>"); + m_label.set_halign(Gtk::ALIGN_START); + m_bio.set_halign(Gtk::ALIGN_START); + m_bio.set_line_wrap(true); + m_bio.set_line_wrap_mode(Pango::WRAP_WORD_CHAR); + + m_label.show(); + m_bio.show(); + + add(m_label); + add(m_bio); +} + +void BioContainer::SetBio(const std::string &bio) { + m_bio.set_text(bio); +} + ProfileUserInfoPane::ProfileUserInfoPane(Snowflake ID) : Gtk::Box(Gtk::ORIENTATION_VERTICAL) , UserID(ID) { @@ -194,12 +213,23 @@ ProfileUserInfoPane::ProfileUserInfoPane(Snowflake ID) m_conns.set_halign(Gtk::ALIGN_START); m_conns.set_hexpand(true); + m_created.show(); + m_note.show(); + m_conns.show(); + add(m_created); + add(m_bio); add(m_note); add(m_conns); - show_all_children(); } -void ProfileUserInfoPane::SetConnections(const std::vector<ConnectionData> &connections) { - m_conns.SetConnections(connections); +void ProfileUserInfoPane::SetProfile(const UserProfileData &data) { + if (data.User.Bio.has_value() && *data.User.Bio != "") { + m_bio.SetBio(*data.User.Bio); + m_bio.show(); + } else { + m_bio.hide(); + } + + m_conns.SetConnections(data.ConnectedAccounts); } |