Fix padding color not tracking active window bg color
This commit is contained in:
parent
f25ecedcab
commit
8f423c6d8f
@ -320,6 +320,15 @@ class Boss:
|
||||
self.current_key_press_info = key, scancode, action, mods
|
||||
return self.dispatch_action(key_action)
|
||||
|
||||
def default_bg_changed_for(self, window_id):
|
||||
w = self.window_id_map.get(window_id)
|
||||
if w is not None:
|
||||
tm = self.os_window_map.get(w.os_window_id)
|
||||
if tm is not None:
|
||||
t = tm.tab_for_id(w.tab_id)
|
||||
if t is not None:
|
||||
t.relayout_borders()
|
||||
|
||||
def dispatch_action(self, key_action):
|
||||
if key_action is not None:
|
||||
f = getattr(self, key_action.func, None)
|
||||
|
||||
@ -426,6 +426,11 @@ class TabManager: # {{{
|
||||
if t is not None:
|
||||
return t.active_window
|
||||
|
||||
def tab_for_id(self, tab_id):
|
||||
for t in self.tabs:
|
||||
if t.id == tab_id:
|
||||
return t
|
||||
|
||||
def move_tab(self, delta=1):
|
||||
if len(self.tabs) > 1:
|
||||
idx = self.active_tab_idx
|
||||
|
||||
@ -228,7 +228,7 @@ class Window:
|
||||
pass # TODO: Implement this
|
||||
|
||||
def change_colors(self, changes):
|
||||
dirtied = False
|
||||
dirtied = default_bg_changed = False
|
||||
|
||||
def item(raw):
|
||||
if raw is None:
|
||||
@ -242,8 +242,12 @@ class Window:
|
||||
continue
|
||||
dirtied = True
|
||||
setattr(self.screen.color_profile, which.name, val)
|
||||
if which.name == 'default_bg':
|
||||
default_bg_changed = True
|
||||
if dirtied:
|
||||
self.screen.mark_as_dirty()
|
||||
if default_bg_changed:
|
||||
get_boss().default_bg_changed_for(self.id)
|
||||
|
||||
def report_color(self, code, r, g, b):
|
||||
r |= r << 8
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user