This commit is contained in:
Kovid Goyal 2017-10-21 14:03:48 +05:30
parent 17cfd98545
commit a527cc88f3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -65,6 +65,12 @@ def load_shader_programs():
init_cursor_program() init_cursor_program()
def setup_colors(screen, opts):
screen.color_profile.update_ansi_color_table(build_ansi_color_table(opts))
screen.color_profile.set_configured_colors(*map(color_as_int, (
opts.foreground, opts.background, opts.cursor, opts.selection_foreground, opts.selection_background)))
class Window: class Window:
def __init__(self, tab, child, opts, args): def __init__(self, tab, child, opts, args):
@ -83,9 +89,7 @@ class Window:
self.is_visible_in_layout = True self.is_visible_in_layout = True
self.child, self.opts = child, opts self.child, self.opts = child, opts
self.screen = Screen(self, 24, 80, opts.scrollback_lines, self.id) self.screen = Screen(self, 24, 80, opts.scrollback_lines, self.id)
self.screen.color_profile.update_ansi_color_table(build_ansi_color_table(opts)) setup_colors(self.screen, opts)
self.screen.color_profile.set_configured_colors(*map(color_as_int, (
opts.foreground, opts.background, opts.cursor, opts.selection_foreground, opts.selection_background)))
def __repr__(self): def __repr__(self):
return 'Window(title={}, id={})'.format(self.title, self.id) return 'Window(title={}, id={})'.format(self.title, self.id)