convert the unfocused terminal font brightness to alpha transparency level

This commit is contained in:
Matt Rose 2020-11-14 11:03:58 -05:00
parent 77696aa2cd
commit fdcab76408
1 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,8 @@ class Overpaint(Vte.Terminal):
def __init__(self):
Vte.Terminal.__init__(self)
self.config = Config()
self.dim_p = float(self.config['inactive_color_offset'])
self.dim_l = round(1.0 - self.dim_p,3)
def dim(self,b):
self.overpaint = b
@ -44,7 +45,7 @@ class Overpaint(Vte.Terminal):
bgc = Vte.Terminal.get_color_background_for_draw(self)
Vte.Terminal.do_draw(self,cr)
if self.overpaint:
bgc.alpha = float(self.config['inactive_color_offset'])
bgc.alpha = self.dim_l
cr.set_operator(cairo.Operator.OVER)
Gdk.cairo_set_source_rgba(cr,bgc)
cr.rectangle(0.0,0.0,self.get_allocated_width(),self.get_allocated_height())