Commit 7bd73e24 authored by Philipp Hörist's avatar Philipp Hörist

Fuse Emoticons/Authentication with TextView

parent 0b83a675
......@@ -868,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):
......
......@@ -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)
......
This diff is collapsed.
......@@ -126,10 +126,36 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">3</property>
<child>
<object class="GtkMenuButton" id="emoticons_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Show a list of emoticons (Alt+M)</property>
<property name="relief">none</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">face-smile</property>
</object>
</child>
<style>
<class name="msgtextview-button"/>
<class name="left"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="authentication_button">
<property name="name">ChatControl-AuthenticationButton</property>
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
......@@ -144,16 +170,18 @@
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="msgtextview-button"/>
<class name="right"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -166,27 +194,6 @@
<property name="height_request">34</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuButton" id="emoticons_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Show a list of emoticons (Alt+M)</property>
<property name="relief">none</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">face-smile</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="formattings_button">
<property name="visible">True</property>
......@@ -209,19 +216,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="vseparator2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">0</property>
</packing>
</child>
<child>
......@@ -246,7 +241,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
<property name="position">1</property>
</packing>
</child>
<child>
......@@ -271,7 +266,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
<property name="position">2</property>
</packing>
</child>
<child>
......@@ -297,7 +292,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
<property name="position">3</property>
</packing>
</child>
<child>
......@@ -322,7 +317,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
<property name="position">4</property>
</packing>
</child>
<child>
......@@ -334,7 +329,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
<property name="position">5</property>
</packing>
</child>
<child>
......@@ -359,7 +354,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">8</property>
<property name="position">6</property>
</packing>
</child>
<child>
......@@ -370,7 +365,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">9</property>
<property name="position">7</property>
</packing>
</child>
<child>
......@@ -391,15 +386,9 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">10</property>
<property name="position">8</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......
/* 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; }
......
......@@ -801,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):
......
......@@ -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