summaryrefslogtreecommitdiff
path: root/src/components/chatinput.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-06-30 04:20:42 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-06-30 04:20:42 -0400
commite87766f106c1b8e4b57ce59c713fcf4efe6df39a (patch)
tree655de2b0f30d3b15df616a6ce2a39d7440fd78ab /src/components/chatinput.hpp
parenta038f47a255242cb452caac04b4b1a17a4bfd28e (diff)
downloadabaddon-portaudio-e87766f106c1b8e4b57ce59c713fcf4efe6df39a.tar.gz
abaddon-portaudio-e87766f106c1b8e4b57ce59c713fcf4efe6df39a.zip
dnd'd files show preview images if displayable
Diffstat (limited to 'src/components/chatinput.hpp')
-rw-r--r--src/components/chatinput.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/chatinput.hpp b/src/components/chatinput.hpp
index 8a4ad8d..625161a 100644
--- a/src/components/chatinput.hpp
+++ b/src/components/chatinput.hpp
@@ -6,7 +6,7 @@
class ChatInputAttachmentItem : public Gtk::EventBox {
public:
ChatInputAttachmentItem(const Glib::RefPtr<Gio::File> &file);
- ChatInputAttachmentItem(const Glib::RefPtr<Gio::File> &file, const Glib::RefPtr<Gdk::Pixbuf> &pb);
+ ChatInputAttachmentItem(const Glib::RefPtr<Gio::File> &file, const Glib::RefPtr<Gdk::Pixbuf> &pb, bool is_extant = false);
[[nodiscard]] Glib::RefPtr<Gio::File> GetFile() const;
[[nodiscard]] ChatSubmitParams::AttachmentType GetType() const;
@@ -15,6 +15,7 @@ public:
void RemoveIfTemp();
private:
+ void SetFilenameFromFile();
void SetupMenu();
void UpdateTooltip();
@@ -45,7 +46,7 @@ public:
void Clear();
void ClearNoPurge();
bool AddImage(const Glib::RefPtr<Gdk::Pixbuf> &pb);
- bool AddFile(const Glib::RefPtr<Gio::File> &file);
+ bool AddFile(const Glib::RefPtr<Gio::File> &file, Glib::RefPtr<Gdk::Pixbuf> pb = {});
[[nodiscard]] std::vector<ChatSubmitParams::Attachment> GetAttachments() const;
private:
@@ -103,6 +104,8 @@ public:
void AddAttachment(const Glib::RefPtr<Gio::File> &file);
private:
+ bool AddFileAsImageAttachment(const Glib::RefPtr<Gio::File> &file);
+
Gtk::Revealer m_attachments_revealer;
ChatInputAttachmentContainer m_attachments;
ChatInputText m_input;