check nitro size restriction + fix replying border

This commit is contained in:
ouwou
2022-07-09 01:57:56 -04:00
parent 241d9a2140
commit 02ce353c6d
5 changed files with 52 additions and 3 deletions

View File

@@ -392,6 +392,23 @@ void ChatInput::AddAttachment(const Glib::RefPtr<Gio::File> &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<Gio::File> &file) {
try {
const auto read_stream = file->read();