From 4e1b8b9fe947d4481cf7240440b3dda288854093 Mon Sep 17 00:00:00 2001 From: Nico Alt <nicoalt@posteo.org> Date: Wed, 30 Dec 2020 12:00:00 +0000 Subject: [PATCH] Rename chat_entry to chat_input "Entry" is a widget in GTK and "input" is something more generalized. --- .../briar_gtk/presenters/private_chat.py | 30 +++++++++---------- briar-gtk/data/ui/main_window.ui | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/briar-gtk/briar_gtk/presenters/private_chat.py b/briar-gtk/briar_gtk/presenters/private_chat.py index 57f43fb..b3258b1 100644 --- a/briar-gtk/briar_gtk/presenters/private_chat.py +++ b/briar-gtk/briar_gtk/presenters/private_chat.py @@ -87,8 +87,8 @@ class PrivateChatPresenter: confirmation_dialog.show_all() def open_emoji_menu(self): - chat_entry = self._view.builder.get_object("chat_entry") - chat_entry.emit("insert-emoji") + chat_input = self._view.builder.get_object("chat_input") + chat_input.emit("insert-emoji") def close_private_chat(self): # formerly `show_sidebar` main_content_stack = self._view.builder.get_object( @@ -101,7 +101,7 @@ class PrivateChatPresenter: self._set_contact_name_label("") self._view.contact_id = 0 self._hide_chat_menu_button() - self._disconnect_chat_entry_signals() + self._disconnect_chat_input_signals() def disconnect_signals(self): for signal in self._signals: @@ -168,7 +168,7 @@ class PrivateChatPresenter: self._setup_message_listener() self._mark_messages_read(messages, private_chat) self._setup_history_container() - self._setup_chat_entry() + self._setup_chat_input() def _setup_message_listener(self): # TODO: Move into briar_wrapper by adding function to PrivateChatModel @@ -188,14 +188,14 @@ class PrivateChatPresenter: history_container.add(self._view) history_container.show_all() - def _setup_chat_entry(self): - chat_entry = self._view.builder.get_object("chat_entry") - self._chat_entry_signal_id = chat_entry.connect( - "key-press-event", self._on_chat_entry_activate + def _setup_chat_input(self): + chat_input = self._view.builder.get_object("chat_input") + self._chat_input_signal_id = chat_input.connect( + "key-press-event", self._on_chat_input_activate ) # TODO: Activate vscrollbar only if needed (to save space) # https://github.com/dino/dino/blob/231df1/main/src/ui/chat_input/chat_text_view.vala#L51 - chat_entry.grab_focus() + chat_input.grab_focus() @staticmethod def _hide_chat_view(main_content_stack): @@ -243,14 +243,14 @@ class PrivateChatPresenter: for child in children: child.destroy() - def _disconnect_chat_entry_signals(self): - if not hasattr(self, "_chat_entry_signal_id"): + def _disconnect_chat_input_signals(self): + if not hasattr(self, "_chat_input_signal_id"): return - chat_entry = self._view.builder.get_object("chat_entry") - chat_entry.disconnect(self._chat_entry_signal_id) - del self._chat_entry_signal_id + chat_input = self._view.builder.get_object("chat_input") + chat_input.disconnect(self._chat_input_signal_id) + del self._chat_input_signal_id - def _on_chat_entry_activate(self, widget, event): + def _on_chat_input_activate(self, widget, event): # Return is pressed if Gdk.keyval_name(event.keyval) != 'Return': return False diff --git a/briar-gtk/data/ui/main_window.ui b/briar-gtk/data/ui/main_window.ui index f9e59aa..c19d374 100644 --- a/briar-gtk/data/ui/main_window.ui +++ b/briar-gtk/data/ui/main_window.ui @@ -132,7 +132,7 @@ <property name="propagate_natural_height">True</property> <property name="max_content_height">300</property> <child> - <object class="GtkTextView" id="chat_entry"> + <object class="GtkTextView" id="chat_input"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> -- GitLab