Commit cea15bd0 authored by Nico's avatar Nico
Browse files

Remove send button

With an eventually upcoming file attachment button (and separate voice
button) the UI might become too clunky with a send button. In addition,
no other major desktop chatting program seems to have one, since sending
via pressing enter is the standard.

Basically reverts 6b9f691c
parent 9adee7c9
......@@ -31,7 +31,6 @@ class WindowActions(Actions):
self._setup_open_emoji_menu_action()
self._setup_open_main_window_action()
self._setup_open_private_chat_action()
self._setup_send_message_action()
def _setup_back_to_sidebar_action(self):
self._setup_action("back-to-sidebar", None, self._back_to_sidebar)
......@@ -67,9 +66,6 @@ class WindowActions(Actions):
self._setup_action("open-private-chat", GLib.VariantType.new("i"),
self._open_private_chat)
def _setup_send_message_action(self):
self._setup_action("send-message", None, self._send_message)
# pylint: disable=unused-argument
def _back_to_sidebar(self, action, parameter):
if not isinstance(self.widget.current_view, MainWindowView):
......@@ -122,9 +118,3 @@ class WindowActions(Actions):
"Should open private chat only from MainWindowView")
self.widget.current_view.presenter.open_private_chat(
contact_id.get_int32())
# pylint: disable=unused-argument
def _send_message(self, action, parameter):
if not isinstance(self.widget.current_view, MainWindowView):
raise Exception("Should send message only from MainWindowView")
self.widget.current_view.presenter.send_message()
......@@ -53,10 +53,6 @@ class MainWindowPresenter:
self._view.builder, contact_id, self._sidebar_presenter)
self._private_chat_presenter = private_chat_view.presenter
def send_message(self):
if isinstance(self._private_chat_presenter, PrivateChatPresenter):
self._private_chat_presenter.send_message()
def _setup_destroy_listener(self):
self._view.connect("destroy", self._on_destroy)
......
......@@ -103,15 +103,6 @@ class PrivateChatPresenter:
self._hide_chat_menu_button()
self._disconnect_chat_entry_signals()
def send_message(self):
chat_entry = self._view.builder.get_object("chat_entry")
# Text does not only contain whitespace
if len(self._get_text_from_text_view(chat_entry).strip()) == 0:
return False
self._send_message(chat_entry)
self._sidebar_presenter.refresh_contacts()
return True
def disconnect_signals(self):
for signal in self._signals:
APP().api.socket_listener.disconnect(signal)
......
......@@ -125,39 +125,10 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
<child>
<object class="GtkButton" id="entry_emoji_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin-top">3</property>
<property name="margin-bottom">3</property>
<property name="vexpand">False</property>
<property name="valign">start</property>
<property name="relief">none</property>
<property name="action_name">win.open-emoji-menu</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">face-smile-symbolic</property>
</object>
</child>
<accessibility>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-entry_emoji_button">
<property name="AtkObject::accessible_name" translatable="yes">Show emojis</property>
</object>
</child>
<style>
<class name="message-input-button" />
</style>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="margin">6</property>
<property name="propagate_natural_height">True</property>
<property name="max_content_height">300</property>
<child>
......@@ -175,7 +146,7 @@
</object>
</child>
<child>
<object class="GtkButton" id="entry_send_button">
<object class="GtkButton" id="entry_emoji_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin-top">3</property>
......@@ -183,20 +154,20 @@
<property name="vexpand">False</property>
<property name="valign">start</property>
<property name="relief">none</property>
<property name="action_name">win.send-message</property>
<property name="action_name">win.open-emoji-menu</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-playback-start</property>
<property name="icon_name">face-smile-symbolic</property>
</object>
</child>
<accessibility>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-entry_send_button">
<property name="AtkObject::accessible_name" translatable="yes">Send</property>
<object class="AtkObject" id="a11y-entry_emoji_button">
<property name="AtkObject::accessible_name" translatable="yes">Show emojis</property>
</object>
</child>
<style>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment