Update background image without restarting

This commit is contained in:
Vulcalien 2021-12-08 16:05:38 +01:00
parent 25902fd73e
commit a06e7951f6
2 changed files with 7 additions and 9 deletions

View File

@ -212,6 +212,7 @@ DEFAULTS = {
'background_color' : '#000000',
'background_darkness' : 0.5,
'background_type' : 'solid',
'background_image' : '',
'backspace_binding' : 'ascii-del',
'delete_binding' : 'escape-sequence',
'color_scheme' : 'grey_on_black',
@ -253,8 +254,6 @@ DEFAULTS = {
'autoclean_groups' : True,
'http_proxy' : '',
'ignore_hosts' : ['localhost','127.0.0.0/8','*.local'],
'background_image' : '',
'background_alpha' : 0.0,
# Titlebar
'title_hide_sizetext' : False,
'title_transmit_fg_color' : '#ffffff',

View File

@ -149,12 +149,6 @@ class Terminal(Gtk.VBox):
self.composite_support = True
dbg('composite_support: %s' % self.composite_support)
self.background_alpha = self.config['background_darkness']
if self.config['background_type'] == 'image' and self.config['background_image'] != '':
self.set_background_image(self.config['background_image'])
else:
self.background_image = None
self.vte.show()
self.update_url_matches()
@ -723,11 +717,16 @@ class Terminal(Gtk.VBox):
self.bgcolor = Gdk.RGBA()
self.bgcolor.parse(self.config['background_color'])
if self.config['background_type'] == 'transparent' or self.config['background_type'] == 'image':
if self.config['background_type'] in ('transparent', 'image'):
self.bgcolor.alpha = self.config['background_darkness']
else:
self.bgcolor.alpha = 1
if self.config['background_type'] == 'image' and self.config['background_image'] != '':
self.set_background_image(self.config['background_image'])
else:
self.background_image = None
factor = self.config['inactive_color_offset']
if factor > 1.0:
factor = 1.0