hopefully take care of some annoying bugs

This commit is contained in:
ouwou
2020-09-30 15:12:52 -04:00
parent 7965b788b1
commit 872b15e6af
5 changed files with 24 additions and 24 deletions

View File

@@ -46,13 +46,7 @@ ChannelListRowDMChannel::ChannelListRowDMChannel(const Channel *data) {
m_icon = Gtk::manage(new Gtk::Image(buf));
else {
m_icon = Gtk::manage(new Gtk::Image(Abaddon::Get().GetImageManager().GetPlaceholder(24)));
Abaddon::Get().GetImageManager().LoadFromURL(data->Recipients[0].GetAvatarURL("png", "16"), [this](Glib::RefPtr<Gdk::Pixbuf> ldbuf) {
Glib::signal_idle().connect([this, ldbuf]() -> bool {
m_icon->property_pixbuf() = ldbuf;
return false;
});
});
Abaddon::Get().GetImageManager().LoadFromURL(data->Recipients[0].GetAvatarURL("png", "16"), sigc::mem_fun(*this, &ChannelListRowDMChannel::OnImageLoad));
}
}
@@ -70,6 +64,11 @@ ChannelListRowDMChannel::ChannelListRowDMChannel(const Channel *data) {
show_all_children();
}
void ChannelListRowDMChannel::OnImageLoad(Glib::RefPtr<Gdk::Pixbuf> buf) {
if (m_icon != nullptr)
m_icon->property_pixbuf() = buf;
}
ChannelListRowGuild::ChannelListRowGuild(const Guild *data) {
ID = data->ID;
m_ev = Gtk::manage(new Gtk::EventBox);