When a window loses focus, update all the terminals within to show the inactive titlebar colours. Closes LP #576276

This commit is contained in:
Chris Jones 2010-07-03 20:00:04 +01:00
parent 597f4ff75d
commit d1989ec4a6
3 changed files with 12 additions and 2 deletions

View File

@ -982,6 +982,10 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
"""Inform other parts of the application when focus is received"""
self.emit('focus-in')
def on_window_focus_out(self):
"""Update our UI when the window loses focus"""
self.titlebar.update('window-focus-out')
def scrollbar_jump(self, position):
"""Move the scrollbar to a particular row"""
self.scrollbar.set_value(position)

View File

@ -127,7 +127,13 @@ class Titlebar(gtk.EventBox):
default_bg = True
group_fg = self.config['title_inactive_fg_color']
group_bg = self.config['title_inactive_bg_color']
elif other == 'window-focus-out':
title_fg = self.config['title_inactive_fg_color']
title_bg = self.config['title_inactive_bg_color']
icon = '_receive_off'
default_bg = True
else:
# We're the active terminal
title_fg = self.config['title_transmit_fg_color']
title_bg = self.config['title_transmit_bg_color']
if terminator.groupsend == terminator.groupsend_type['all']:

View File

@ -186,8 +186,8 @@ class Window(Container, gtk.Window):
def on_focus_out(self, window, event):
"""Focus has left the window"""
# FIXME: Cause the terminal titlebars to update here
pass
for terminal in self.get_visible_terminals():
terminal.on_window_focus_out()
def on_focus_in(self, window, event):
"""Focus has entered the window"""