From d9c6c9c4969619478d37bad790e84e8d6e583acc Mon Sep 17 00:00:00 2001 From: "Braden M. Kelley" Date: Fri, 8 Jul 2016 12:04:54 +0200 Subject: [PATCH] Fix transparency for newer versions of GTK --- terminatorlib/terminator.py | 23 +++++++++++++++-------- terminatorlib/window.py | 2 ++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 97f6f3f9..ab2decb1 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -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: diff --git a/terminatorlib/window.py b/terminatorlib/window.py index f6f38e59..cef9fdbf 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -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=''