Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
cb307379 by wurstsalat at 2025-01-19T18:28:45+01:00
refactor: MessageActionsBox: Make variable private
- - - - -
f4f0a55c by wurstsalat at 2025-01-19T18:29:16+01:00
imprv: Control: Disable message selection via Escape key
- - - - -
3 changed files:
- gajim/gtk/chat_stack.py
- gajim/gtk/control.py
- gajim/gtk/message_actions_box.py
Changes:
=====================================
gajim/gtk/chat_stack.py
=====================================
@@ -141,6 +141,9 @@ def process_escape(self) -> bool:
self._chat_function_page.process_escape()
return True
+ if self._chat_control.process_escape():
+ return True
+
return self._message_action_box.process_escape()
def get_chat_control(self) -> ChatControl:
=====================================
gajim/gtk/control.py
=====================================
@@ -75,7 +75,7 @@ def __init__(self) -> None:
self._message_selection = MessageSelection()
self._message_selection.connect("copy", self._on_copy_selection)
- self._message_selection.connect("cancel", self._on_cancel_selection)
+ self._message_selection.connect("cancel",
self._reset_message_selection)
self._ui.conv_view_overlay.add_overlay(self._message_selection)
self._jump_to_end_button = JumpToEndButton()
@@ -195,6 +195,14 @@ def scroll_to_message(self, pk: int, timestamp:
dt.datetime) -> None:
def mark_as_read(self) -> None:
self._jump_to_end_button.reset_unread_count()
+ def process_escape(self) -> bool:
+ message_selection_active = self._message_selection.get_visible()
+ if message_selection_active:
+ self._reset_message_selection()
+ return True
+
+ return False
+
def switch_contact(
self, contact: BareContact | GroupchatContact | GroupchatParticipant
) -> None:
@@ -214,8 +222,7 @@ def switch_contact(
self._groupchat_state.switch_contact(contact)
self._roster.switch_contact(contact)
- self._message_selection.set_visible(False)
- self._message_selection.hide()
+ self._reset_message_selection()
self._register_events()
@@ -440,12 +447,14 @@ def _on_activate_message_selection(
self._scrolled_view.enable_row_selection(pk)
self._message_selection.show()
+ def _reset_message_selection(self, *args: Any) -> None:
+ self._scrolled_view.disable_row_selection()
+ self._message_selection.set_visible(False)
+ self._message_selection.hide()
+
def _on_copy_selection(self, _widget: MessageSelection) -> None:
self._scrolled_view.copy_selected_messages()
- def _on_cancel_selection(self, _widget: MessageSelection) -> None:
- self._scrolled_view.disable_row_selection()
-
def _on_jump_to_message(
self, _action: Gio.SimpleAction, param: GLib.Variant
) -> None:
=====================================
gajim/gtk/message_actions_box.py
=====================================
@@ -90,10 +90,10 @@ def __init__(self) -> None:
"show_send_message_button", self._ui.send_message_button,
"set_visible"
)
- self.voice_message_recorder_button = VoiceMessageRecorderButton()
- self._ui.action_box.append(self.voice_message_recorder_button)
+ voice_message_recorder_button = VoiceMessageRecorderButton()
+ self._ui.action_box.append(voice_message_recorder_button)
self._ui.action_box.reorder_child_after(
- self.voice_message_recorder_button, self._ui.send_message_button
+ voice_message_recorder_button, self._ui.send_message_button
)
self._security_label_selector = SecurityLabelSelector()
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/b2b9e4828291bda4c94172dedf98e2cec4ef8c38...f4f0a55cbc1a89a50bb04423520d646a3b38dace
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/b2b9e4828291bda4c94172dedf98e2cec4ef8c38...f4f0a55cbc1a89a50bb04423520d646a3b38dace
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]