From 02ce353c6d35af004dc1b6f5ae9f68fbb8540b54 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 9 Jul 2022 01:57:56 -0400 Subject: check nitro size restriction + fix replying border --- src/components/chatinput.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/components/chatinput.cpp') diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index b71a234..fc5ef38 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -392,6 +392,23 @@ void ChatInput::AddAttachment(const Glib::RefPtr &file) { } } +void ChatInput::IndicateTooLarge() { + m_input.get_style_context()->add_class("bad-input"); + const auto cb = [this] { + m_input.get_style_context()->remove_class("bad-input"); + }; + Glib::signal_timeout().connect_seconds_once(sigc::track_obj(cb, *this), 2); +} + +void ChatInput::StartReplying() { + m_input.grab_focus(); + m_input.get_style_context()->add_class("replying"); +} + +void ChatInput::StopReplying() { + m_input.get_style_context()->remove_class("replying"); +} + bool ChatInput::AddFileAsImageAttachment(const Glib::RefPtr &file) { try { const auto read_stream = file->read(); -- cgit v1.2.3