diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/chatmessage.cpp | 3 | ||||
-rw-r--r-- | src/components/lazyimage.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/components/chatmessage.cpp b/src/components/chatmessage.cpp index 23ee36f..d1d9f72 100644 --- a/src/components/chatmessage.cpp +++ b/src/components/chatmessage.cpp @@ -204,7 +204,8 @@ void ChatMessageItemContainer::UpdateTextComponent(Gtk::TextView *tv) { if (data->Application.has_value()) { static const auto regex = Glib::Regex::create(R"(</(.*?):(\d+)>)"); Glib::MatchInfo match; - if (regex->match(data->Content, match)) { + Glib::ustring string = data->Content; + if (regex->match(string, match)) { const auto cmd = match.fetch(1); const auto app = data->Application->Name; b->insert_markup(s, "<i>used <span color='#697ec4'>" + cmd + "</span> with " + app + "</i>"); diff --git a/src/components/lazyimage.cpp b/src/components/lazyimage.cpp index 13bd65d..90b8f28 100644 --- a/src/components/lazyimage.cpp +++ b/src/components/lazyimage.cpp @@ -39,7 +39,9 @@ bool LazyImage::OnDraw(const Cairo::RefPtr<Cairo::Context> &context) { Abaddon::Get().GetImageManager().LoadAnimationFromURL(m_url, m_width, m_height, sigc::track_obj(cb, *this)); } else { auto cb = [this](const Glib::RefPtr<Gdk::Pixbuf> &pb) { - property_pixbuf() = pb->scale_simple(m_width, m_height, Gdk::INTERP_BILINEAR); + int cw, ch; + GetImageDimensions(pb->get_width(), pb->get_height(), cw, ch, m_width, m_height); + property_pixbuf() = pb->scale_simple(cw, ch, Gdk::INTERP_BILINEAR); }; Abaddon::Get().GetImageManager().LoadFromURL(m_url, sigc::track_obj(cb, *this)); |