Move CSS Code into gajim.css

This commit is contained in:
Philipp Hörist 2017-03-04 09:53:14 +01:00
parent 9bcad9a233
commit c02260c4d1
5 changed files with 18 additions and 16 deletions

View File

@ -606,6 +606,7 @@
<property name="spacing">3</property>
<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>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkWindow" id="vcard_information_window">
@ -914,6 +914,9 @@
<property name="halign">start</property>
<property name="relief">none</property>
<property name="xalign">0</property>
<style>
<class name="VCard-GtkLinkButton"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
@ -929,6 +932,9 @@
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="xalign">0</property>
<style>
<class name="VCard-GtkLinkButton"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
@ -1327,6 +1333,9 @@
<property name="halign">start</property>
<property name="relief">none</property>
<property name="xalign">0</property>
<style>
<class name="VCard-GtkLinkButton"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>

View File

@ -0,0 +1,7 @@
/* Gajim Application CSS File */
/* ChatControl */
#ChatControl-AuthenticationButton { padding-top: 0px; padding-bottom: 0px}
/* VCardWindow */
.VCard-GtkLinkButton { padding-left: 5px; border-left: none; }

View File

@ -157,15 +157,6 @@ class ChatControl(ChatControlBase):
# Add lock image to show chat encryption
self.lock_image = self.xml.get_object('lock_image')
# Remove padding from authentication button or else it will
# be higher than the message box
style_provider = Gtk.CssProvider()
css = 'GtkButton { padding-top: 0px; padding-bottom: 0px}'
style_provider.load_from_data(css.encode())
context = self.authentication_button.get_style_context()
context.add_provider(style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_USER)
# Convert to GC icon
img = self.xml.get_object('convert_to_gc_button_image')
img.set_from_pixbuf(gtkgui_helpers.load_icon(

View File

@ -147,16 +147,10 @@ class VcardWindow:
buffer_ = self.xml.get_object('textview_annotation').get_buffer()
buffer_.set_text(annotations[self.contact.jid])
style_provider = Gtk.CssProvider()
css = 'GtkButton { padding-left: 5px; border-left: none; }'
style_provider.load_from_data(css.encode())
for widget_name in ('URL_label',
'EMAIL_WORK_USERID_label',
'EMAIL_HOME_USERID_label'):
widget = self.xml.get_object(widget_name)
context = widget.get_style_context()
context.add_provider(style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_USER)
widget.hide()
self.xml.connect_signals(self)