From 344f2694141aa0cc8fc214dfd8ce2011df1a8079 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 7 Aug 2022 02:16:20 -0400 Subject: add file picker to chat input --- src/components/chatinput.hpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/components/chatinput.hpp') diff --git a/src/components/chatinput.hpp b/src/components/chatinput.hpp index d8484b8..82ea2fd 100644 --- a/src/components/chatinput.hpp +++ b/src/components/chatinput.hpp @@ -95,6 +95,30 @@ private: type_signal_image_paste m_signal_image_paste; }; +// file upload, text +class ChatInputTextContainer : public Gtk::Overlay { +public: + ChatInputTextContainer(); + + // not proxying everythign lol!! + ChatInputText &Get(); + +private: + void ShowFileChooser(); + bool GetChildPosition(Gtk::Widget *child, Gdk::Rectangle &pos); + + Gtk::EventBox m_upload_ev; + Gtk::Image m_upload_img; + ChatInputText m_input; + +public: + using type_signal_add_attachment = sigc::signal>; + type_signal_add_attachment signal_add_attachment(); + +private: + type_signal_add_attachment m_signal_add_attachment; +}; + class ChatInput : public Gtk::Box { public: ChatInput(); @@ -113,7 +137,7 @@ private: Gtk::Revealer m_attachments_revealer; ChatInputAttachmentContainer m_attachments; - ChatInputText m_input; + ChatInputTextContainer m_input; public: using type_signal_submit = sigc::signal; -- cgit v1.2.3