content: Update send button action name

This commit is contained in:
Kévin Commaille 2021-05-26 18:31:28 +02:00
parent d547b9adfc
commit 390066e090
No known key found for this signature in database
GPG key ID: 296D60AE1E61661C

View file

@ -145,7 +145,7 @@ mod imp {
key_events
.connect_key_pressed(clone!(@weak obj => @default-return Inhibit(false), move |_, key, _, modifier| {
if !modifier.contains(gdk::ModifierType::SHIFT_MASK) && (key == gdk::keys::constants::Return || key == gdk::keys::constants::KP_Enter) {
obj.activate_action("content.send-text-message", None);
obj.activate_action("room-history.send-text-message", None);
Inhibit(true)
} else {
Inhibit(false)
@ -160,11 +160,11 @@ mod imp {
buffer.connect_text_notify(clone!(@weak obj => move |buffer| {
let (start_iter, end_iter) = buffer.bounds();
obj.action_set_enabled("content.send-text-message", start_iter != end_iter);
obj.action_set_enabled("room-history.send-text-message", start_iter != end_iter);
}));
let (start_iter, end_iter) = buffer.bounds();
obj.action_set_enabled("content.send-text-message", start_iter != end_iter);
obj.action_set_enabled("room-history.send-text-message", start_iter != end_iter);
let md_lang =
sourceview::LanguageManager::default().and_then(|lm| lm.language("markdown"));