From a038f47a255242cb452caac04b4b1a17a4bfd28e Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Thu, 23 Jun 2022 01:51:30 -0400 Subject: add icon to attachments without preview --- src/components/chatinput.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/components/chatinput.cpp') 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 &file) : m_file(file) - , m_img(Gtk::make_managed(Abaddon::Get().GetImageManager().GetPlaceholder(AttachmentItemSize))) + , m_img(Gtk::make_managed()) , 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 & 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(); -- cgit v1.2.3