Commit f14cfe10 authored by Daniel Brötzmann's avatar Daniel Brötzmann
Browse files

MessageInputTextView: Add focus borders

parent c63b71a8
Pipeline #7533 failed with stages
in 4 minutes and 56 seconds
......@@ -217,6 +217,8 @@ def __init__(self, parent_win, widget_name, contact, acct,
'set_visible')
self.msg_scrolledwindow = ScrolledWindow()
self.msg_scrolledwindow.get_style_context().add_class(
'message-input-border')
self.msg_scrolledwindow.add(self.msg_textview)
self.xml.hbox.pack_start(self.msg_scrolledwindow, True, True, 0)
......
......@@ -30,6 +30,14 @@ .chatcontrol-separator-top {margin-top: 5px;}
.chatcontrol-separator {margin-bottom: 5px;}
.message-input-border {
border: 2px solid transparent;
}
.message-input-focus {
border: 2px solid @theme_selected_bg_color;
border-radius: 4px;
}
.link-button { min-height: 0px; }
/* VCardWindow */
......
......@@ -92,6 +92,8 @@ def __init__(self):
self.end_tags['strike'] = '</span>'
self.connect_after('paste-clipboard', self._after_paste_clipboard)
self.connect('focus-in-event', self._on_focus_in)
self.connect('focus-out-event', self._on_focus_out)
self.connect('destroy', self._on_destroy)
def _on_destroy(self, *args):
......@@ -105,6 +107,16 @@ def _on_destroy(self, *args):
None,
Gdk.DragAction.DEFAULT)
def _on_focus_in(self, _widget, _event):
scrolled = self.get_parent()
scrolled.get_style_context().add_class('message-input-focus')
return False
def _on_focus_out(self, _widget, _event):
scrolled = self.get_parent()
scrolled.get_style_context().remove_class('message-input-focus')
return False
def insert_text(self, text):
self.get_buffer().insert_at_cursor(text)
......
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