Fix transparency for newer versions of GTK

This commit is contained in:
Braden M. Kelley 2016-07-08 12:04:54 +02:00
parent e3323e23e3
commit d9c6c9c496
2 changed files with 17 additions and 8 deletions

View File

@ -372,19 +372,26 @@ class Terminator(Borg):
Gtk.StyleContext.remove_provider_for_screen(
Gdk.Screen.get_default(),
self.style_provider)
self.style_provider = None
css = """
.terminator-terminal-window {
background-color: rgba(0,0,0,0);
}
"""
if self.config['handle_size'] in xrange(0, 6):
css = """
css += """
GtkPaned {
-GtkPaned-handle-size: %s
}
""" % self.config['handle_size']
self.style_provider = Gtk.CssProvider()
self.style_provider.load_from_data(css)
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
self.style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
self.style_provider = Gtk.CssProvider()
self.style_provider.load_from_data(css)
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
self.style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
# Cause all the terminals to reconfigure
for terminal in self.terminals:

View File

@ -64,6 +64,8 @@ class Window(Container, Gtk.Window):
GObject.type_register(Window)
self.register_signals(Window)
self.get_style_context().add_class("terminator-terminal-window")
# self.set_property('allow-shrink', True) # FIXME FOR GTK3, or do we need this actually?
icon_to_apply=''