diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-23 01:51:30 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-23 01:51:30 -0400 |
commit | a038f47a255242cb452caac04b4b1a17a4bfd28e (patch) | |
tree | f5a34c737fb00f51224ee2834cb5023f2c59837a /src/components | |
parent | d841a2c862eddc6b2053b48907f8e1400e2d1391 (diff) | |
download | abaddon-portaudio-a038f47a255242cb452caac04b4b1a17a4bfd28e.tar.gz abaddon-portaudio-a038f47a255242cb452caac04b4b1a17a4bfd28e.zip |
add icon to attachments without preview
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/chatinput.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index a734dec..cd508e8 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -188,15 +188,20 @@ ChatInputAttachmentContainer::type_signal_emptied ChatInputAttachmentContainer:: ChatInputAttachmentItem::ChatInputAttachmentItem(const Glib::RefPtr<Gio::File> &file) : m_file(file) - , m_img(Gtk::make_managed<Gtk::Image>(Abaddon::Get().GetImageManager().GetPlaceholder(AttachmentItemSize))) + , m_img(Gtk::make_managed<Gtk::Image>()) , m_type(ChatSubmitParams::ExtantFile) { get_style_context()->add_class("attachment-item"); set_size_request(AttachmentItemSize, AttachmentItemSize); + m_box.set_halign(Gtk::ALIGN_CENTER); + m_box.set_valign(Gtk::ALIGN_CENTER); m_box.add(*m_img); add(m_box); show_all_children(); + m_img->property_icon_name() = "document-send-symbolic"; + m_img->property_icon_size() = Gtk::ICON_SIZE_DIALOG; // todo figure out how to not use this weird property??? i dont know how icons work (screw your theme) + SetupMenu(); auto info = m_file->query_info(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); @@ -215,6 +220,8 @@ ChatInputAttachmentItem::ChatInputAttachmentItem(const Glib::RefPtr<Gio::File> & m_img->property_pixbuf() = pb->scale_simple(outw, outh, Gdk::INTERP_BILINEAR); set_size_request(AttachmentItemSize, AttachmentItemSize); + m_box.set_halign(Gtk::ALIGN_CENTER); + m_box.set_valign(Gtk::ALIGN_CENTER); m_box.add(*m_img); add(m_box); show_all_children(); |