Skip to content

Commit

Permalink
Update background image without restarting
Browse files Browse the repository at this point in the history
  • Loading branch information
Vulcalien committed Dec 8, 2021
1 parent 25902fd commit a06e795
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions terminatorlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
'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',
Expand Down Expand Up @@ -253,8 +254,6 @@
'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',
Expand Down
13 changes: 6 additions & 7 deletions terminatorlib/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ def __init__(self):
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()

Expand Down Expand Up @@ -723,11 +717,16 @@ def reconfigure(self, _widget=None):
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
Expand Down

0 comments on commit a06e795

Please sign in to comment.