Philipp Hörist pushed to branch master at gajim / gajim
Commits: 7bd73e24 by Philipp Hörist at 2017-10-03T03:12:31+02:00 Fuse Emoticons/Authentication with TextView
- - - - -
7 changed files:
- gajim/chat_control.py - gajim/chat_control_base.py - gajim/data/gui/chat_control.ui - gajim/data/gui/groupchat_control.ui - gajim/data/style/gajim.css - gajim/groupchat_control.py - gajim/message_textview.py
Changes:
===================================== gajim/chat_control.py ===================================== --- a/gajim/chat_control.py +++ b/gajim/chat_control.py @@ -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):
===================================== gajim/chat_control_base.py ===================================== --- a/gajim/chat_control_base.py +++ b/gajim/chat_control_base.py @@ -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)
===================================== gajim/data/gui/chat_control.ui ===================================== --- a/gajim/data/gui/chat_control.ui +++ b/gajim/data/gui/chat_control.ui @@ -598,10 +598,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> @@ -616,16 +642,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> @@ -645,27 +673,6 @@ <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="GtkMenuButton" id="formattings_button"> <property name="visible">True</property> <property name="can_focus">True</property> @@ -687,7 +694,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">0</property> </packing> </child> <child> @@ -700,7 +707,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">1</property> </packing> </child> <child> @@ -726,7 +733,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">3</property> + <property name="position">2</property> </packing> </child> <child> @@ -749,7 +756,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">4</property> + <property name="position">3</property> </packing> </child> <child> @@ -770,7 +777,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">4</property> </packing> </child> <child> @@ -791,7 +798,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">5</property> </packing> </child> <child> @@ -818,7 +825,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">7</property> + <property name="position">6</property> </packing> </child> <child> @@ -845,7 +852,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">8</property> + <property name="position">7</property> </packing> </child> <child> @@ -871,7 +878,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">9</property> + <property name="position">8</property> </packing> </child> <child> @@ -884,7 +891,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">10</property> + <property name="position">9</property> </packing> </child> <child> @@ -911,7 +918,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">11</property> + <property name="position">10</property> </packing> </child> <child> @@ -932,7 +939,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">12</property> + <property name="position">11</property> </packing> </child> <child> @@ -1035,7 +1042,7 @@ audio-mic-volume-low</property> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">13</property> + <property name="position">12</property> </packing> </child> <child> @@ -1046,15 +1053,9 @@ audio-mic-volume-low</property> <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">14</property> + <property name="position">13</property> </packing> </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> </object> <packing> <property name="expand">False</property>
===================================== gajim/data/gui/groupchat_control.ui ===================================== --- a/gajim/data/gui/groupchat_control.ui +++ b/gajim/data/gui/groupchat_control.ui @@ -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> @@ -167,27 +195,6 @@ <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> <property name="can_focus">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/data/style/gajim.css ===================================== --- a/gajim/data/style/gajim.css +++ b/gajim/data/style/gajim.css @@ -1,7 +1,28 @@ /* 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; }
===================================== gajim/groupchat_control.py ===================================== --- a/gajim/groupchat_control.py +++ b/gajim/groupchat_control.py @@ -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):
===================================== gajim/message_textview.py ===================================== --- a/gajim/message_textview.py +++ b/gajim/message_textview.py @@ -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)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/7bd73e24244babcd6cf1b10808734dce64f...
--- View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/7bd73e24244babcd6cf1b10808734dce64f... You're receiving this email because of your account on dev.gajim.org.