Commit 67973b5a authored by Martin's avatar Martin

Imported upstream master from 2017-10-03

parent df865e3d
......@@ -324,11 +324,6 @@ class ChatControl(ChatControlBase):
app.events.event_removed_unsubscribe(self.on_event_removed)
def _update_toolbar(self):
if (app.connections[self.account].connected > 1 and not \
self.TYPE_ID == 'pm') or (self.contact.show != 'offline' and \
self.TYPE_ID == 'pm'):
send_button = self.xml.get_object('send_button')
send_button.set_sensitive(True)
# Formatting
# TODO: find out what encryption allows for xhtml and which not
if self.contact.supports(NS_XHTML_IM):
......@@ -873,6 +868,11 @@ class ChatControl(ChatControlBase):
self.authentication_button.set_tooltip_text(tooltip)
self.widget_set_visible(self.authentication_button, not visible)
context = self.msg_scrolledwindow.get_style_context()
if visible:
context.add_class('authentication')
else:
context.remove_class('authentication')
self.lock_image.set_sensitive(visible)
def _on_authentication_button_clicked(self, widget):
......@@ -1648,13 +1648,8 @@ class ChatControl(ChatControlBase):
if contact:
self.contact = contact
self.draw_banner()
send_button = self.xml.get_object('send_button')
send_button.set_sensitive(True)
def got_disconnected(self):
# Emoticons button
send_button = self.xml.get_object('send_button')
send_button.set_sensitive(False)
# Add to roster
self._add_to_roster_button.hide()
# Audio button
......
......@@ -333,12 +333,13 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
self.msg_scrolledwindow = ScrolledWindow()
self.msg_scrolledwindow.set_max_content_height(100)
self.msg_scrolledwindow.set_min_content_height(23)
self.msg_scrolledwindow.get_style_context().add_class('scrolledtextview')
self.msg_scrolledwindow.set_property('shadow_type', Gtk.ShadowType.IN)
self.msg_scrolledwindow.add(self.msg_textview)
hbox = self.xml.get_object('hbox')
hbox.pack_end(self.msg_scrolledwindow, True, True, 0)
hbox.pack_start(self.msg_scrolledwindow, True, True, 0)
id_ = self.msg_textview.connect('key_press_event',
self._on_message_textview_key_press_event)
......@@ -353,12 +354,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
self.msg_textview.drag_dest_set(Gtk.DestDefaults.MOTION |
Gtk.DestDefaults.HIGHLIGHT, self.dnd_list, Gdk.DragAction.COPY)
# Hook up send button
widget = self.xml.get_object('send_button')
id_ = widget.connect('clicked', self._on_send_button_clicked)
widget.set_sensitive(False)
self.handlers[id_] = widget
# the following vars are used to keep history of user's messages
self.sent_history = []
self.sent_history_pos = 0
......@@ -566,20 +561,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
if event.button == 3: # right click
self.parent_win.popup_menu(event)
def _on_send_button_clicked(self, widget):
"""
When send button is pressed: send the current message
"""
message_buffer = self.msg_textview.get_buffer()
emoticons.replace_with_codepoint(message_buffer)
start_iter = message_buffer.get_start_iter()
end_iter = message_buffer.get_end_iter()
message = message_buffer.get_text(start_iter, end_iter, False)
xhtml = self.msg_textview.get_xhtml()
# send the message
self.send_message(message, xhtml=xhtml)
def _conv_textview_key_press_event(self, widget, event):
# translate any layout to latin_layout
valid, entries = self.keymap.get_entries_for_keyval(event.keyval)
......
......@@ -101,7 +101,7 @@ class Config:
'urlmsgcolor': [ opt_color, '#204a87', '', True ],
'notif_signin_color': [ opt_color, '#32CD32', _('Contact signed in notification color.') ], # limegreen
'notif_signout_color': [ opt_color, '#FF0000', _('Contact signout notification color') ], # red
'notif_message_color': [ opt_color, '#1E90FF', _('New message/email notification color.') ], # dodgerblue
'notif_message_color': [ opt_color, '#1E90FF', _('New message notification color.') ], # dodgerblue
'notif_ftrequest_color': [ opt_color, '#F0E68C', _('File transfer request notification color.') ], # khaki
'notif_fterror_color': [ opt_color, '#B22222', _('File transfer error notification color.') ], # firebrick
'notif_ftcomplete_color': [ opt_color, '#9ACD32', _('File transfer complete or stopped notification color.') ], # yellowgreen
......
This diff is collapsed.
......@@ -5,7 +5,6 @@
<object class="GtkWindow" id="data_form_fake_window">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">window1</property>
<child>
<object class="GtkBox" id="data_form_vbox">
<property name="visible">True</property>
......
This diff is collapsed.
/* Gajim Application CSS File */
/* ChatControl */
#ChatControl-AuthenticationButton { padding-top: 0px; padding-bottom: 0px}
.msgtextview-button {
padding: 0px 5px 0px 5px;
background-color: @theme_base_color;
border: 1px solid;
border-radius: 0px;
border-color: @borders;
}
.msgtextview-button:hover, .msgtextview-button:checked {
color: @theme_base_color;
border-color: @borders;
text-shadow: none;
-gtk-icon-shadow: none;
box-shadow: none;
background-image: none;
}
.msgtextview-button.left { border-right: none; }
.msgtextview-button.right { border-left: none; }
.scrolledtextview { border-left:none; }
.scrolledtextview.authentication { border-right:none; }
/* VCardWindow */
.VCard-GtkLinkButton { padding-left: 5px; border-left: none; }
......
......@@ -296,8 +296,6 @@ class GroupchatControl(ChatControlBase):
# Keep error dialog instance to be sure to have only once at a time
self.error_dialog = None
send_button = self.xml.get_object('send_button')
send_button.set_sensitive(False)
self.actions_button = self.xml.get_object('muc_window_actions_button')
id_ = self.actions_button.connect('clicked',
......@@ -803,6 +801,11 @@ class GroupchatControl(ChatControlBase):
self.authentication_button.set_tooltip_text(tooltip)
self.widget_set_visible(self.authentication_button, not visible)
context = self.msg_scrolledwindow.get_style_context()
if visible:
context.add_class('authentication')
else:
context.remove_class('authentication')
self.lock_image.set_sensitive(visible)
def _on_authentication_button_clicked(self, widget):
......@@ -1439,8 +1442,6 @@ class GroupchatControl(ChatControlBase):
if self.parent_win:
self.parent_win.redraw_tab(self)
send_button = self.xml.get_object('send_button')
send_button.set_sensitive(True)
formattings_button = self.xml.get_object('formattings_button')
formattings_button.set_sensitive(True)
change_nick_button = self.xml.get_object('change_nick_button')
......@@ -1449,8 +1450,6 @@ class GroupchatControl(ChatControlBase):
change_subject_button.set_sensitive(True)
def got_disconnected(self):
send_button = self.xml.get_object('send_button')
send_button.set_sensitive(False)
formattings_button = self.xml.get_object('formattings_button')
formattings_button.set_sensitive(False)
change_nick_button = self.xml.get_object('change_nick_button')
......
......@@ -42,7 +42,7 @@ class MessageTextView(Gtk.TextView):
Gtk.TextView.__init__(self)
# set properties
self.set_border_width(1)
self.set_border_width(3)
self.set_accepts_tab(True)
self.set_editable(True)
self.set_cursor_visible(True)
......
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