diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2024-01-11 21:50:13 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2024-01-11 21:50:13 -0500 |
commit | 012c2dab59b0202586a88af6286b27d79eac61b6 (patch) | |
tree | d2726374a078305bdf546afa04a93c41c85addcf /src/components/chatmessage.cpp | |
parent | c45c090d8449a917b1549e2ec93ddbd0a6fa870c (diff) | |
download | abaddon-portaudio-012c2dab59b0202586a88af6286b27d79eac61b6.tar.gz abaddon-portaudio-012c2dab59b0202586a88af6286b27d79eac61b6.zip |
make image clamp dimensions a setting
Diffstat (limited to 'src/components/chatmessage.cpp')
-rw-r--r-- | src/components/chatmessage.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/chatmessage.cpp b/src/components/chatmessage.cpp index a503294..05954da 100644 --- a/src/components/chatmessage.cpp +++ b/src/components/chatmessage.cpp @@ -431,7 +431,9 @@ Gtk::Widget *ChatMessageItemContainer::CreateEmbedComponent(const EmbedData &emb if (embed.Image.has_value() && embed.Image->ProxyURL.has_value()) { int w = 0, h = 0; - GetImageDimensions(*embed.Image->Width, *embed.Image->Height, w, h, EmbedImageWidth, EmbedImageHeight); + const int clamp_width = Abaddon::Get().GetSettings().ImageEmbedClampWidth; + const int clamp_height = Abaddon::Get().GetSettings().ImageEmbedClampHeight; + GetImageDimensions(*embed.Image->Width, *embed.Image->Height, w, h, clamp_width, clamp_height); auto *img = Gtk::manage(new LazyImage(*embed.Image->ProxyURL, w, h, false)); img->set_halign(Gtk::ALIGN_CENTER); @@ -488,7 +490,9 @@ Gtk::Widget *ChatMessageItemContainer::CreateEmbedComponent(const EmbedData &emb Gtk::Widget *ChatMessageItemContainer::CreateImageComponent(const std::string &proxy_url, const std::string &url, int inw, int inh) { int w, h; - GetImageDimensions(inw, inh, w, h); + const int clamp_width = Abaddon::Get().GetSettings().ImageEmbedClampWidth; + const int clamp_height = Abaddon::Get().GetSettings().ImageEmbedClampHeight; + GetImageDimensions(inw, inh, w, h, clamp_width, clamp_height); Gtk::EventBox *ev = Gtk::manage(new Gtk::EventBox); Gtk::Image *widget = Gtk::manage(new LazyImage(proxy_url, w, h, false)); |