Fix padding color not tracking active window bg color
This commit is contained in:
parent
f25ecedcab
commit
8f423c6d8f
3 changed files with 19 additions and 1 deletions
|
|
@ -320,6 +320,15 @@ def dispatch_special_key(self, key, scancode, action, mods):
|
|||
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 @@ def active_window(self):
|
|||
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 @@ def icon_changed(self, new_icon):
|
|||
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 @@ def item(raw):
|
|||
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…
Reference in a new issue