Make the colours of the titlebars like clusterm (much clearer) and configurable

This commit is contained in:
Stephen Boddy 2009-01-07 19:37:59 +01:00
parent fcea2b7261
commit d205c35a24
3 changed files with 31 additions and 3 deletions

View File

@ -100,6 +100,12 @@ Defaults = {
'close_button_on_tab' : True, 'close_button_on_tab' : True,
'tab_position' : 'top', 'tab_position' : 'top',
'enable_real_transparency' : False, 'enable_real_transparency' : False,
'title_tx_txt_color' : '#FFFFFF',
'title_tx_bg_color' : '#C80003',
'title_rx_txt_color' : '#FFFFFF',
'title_rx_bg_color' : '#0076C9',
'title_ia_txt_color' : '#000000',
'title_ia_bg_color' : '#C0BEBF',
'try_posix_regexp' : platform.system() != 'Linux', 'try_posix_regexp' : platform.system() != 'Linux',
'keybindings' : { 'keybindings' : {
'zoom_in' : '<Ctrl>plus', 'zoom_in' : '<Ctrl>plus',

View File

@ -9,7 +9,7 @@ import gtk, gobject
class ProfileEditor: class ProfileEditor:
# lists of which settings to put in which tabs # lists of which settings to put in which tabs
appearance = ['titlebars', 'titletips', 'allow_bold', 'silent_bell', 'force_no_bell', 'background_darkness', 'background_type', 'background_image', 'cursor_blink', 'font', 'scrollbar_position', 'scroll_background', 'use_system_font', 'use_theme_colors', 'enable_real_transparency'] appearance = ['titlebars', 'titletips', 'allow_bold', 'silent_bell', 'force_no_bell', 'background_darkness', 'background_type', 'background_image', 'cursor_blink', 'font', 'scrollbar_position', 'scroll_background', 'use_system_font', 'use_theme_colors', 'enable_real_transparency']
colours = ['foreground_color','background_color', 'palette'] colours = ['foreground_color','background_color', 'palette', 'title_tx_txt_color', 'title_tx_bg_color', 'title_rx_txt_color', 'title_rx_bg_color', 'title_ia_txt_color', 'title_ia_bg_color']
behaviour = ['backspace_binding', 'delete_binding', 'emulation', 'scroll_on_keystroke', 'scroll_on_output', 'scrollback_lines', 'focus', 'focus_on_close', 'exit_action', 'word_chars', 'mouse_autohide', 'use_custom_command', 'custom_command', 'http_proxy', 'encoding'] behaviour = ['backspace_binding', 'delete_binding', 'emulation', 'scroll_on_keystroke', 'scroll_on_output', 'scrollback_lines', 'focus', 'focus_on_close', 'exit_action', 'word_chars', 'mouse_autohide', 'use_custom_command', 'custom_command', 'http_proxy', 'encoding']
globals = ['fullscreen', 'maximise', 'borderless', 'handle_size', 'cycle_term_tab', 'close_button_on_tab', 'tab_position', 'copy_on_selection', 'extreme_tabs', 'try_posix_regexp'] globals = ['fullscreen', 'maximise', 'borderless', 'handle_size', 'cycle_term_tab', 'close_button_on_tab', 'tab_position', 'copy_on_selection', 'extreme_tabs', 'try_posix_regexp']
@ -38,6 +38,12 @@ class ProfileEditor:
'zoom_normal': ['Zoom reset', ''], 'zoom_normal': ['Zoom reset', ''],
'reset': ['Reset terminal state', ''], 'reset': ['Reset terminal state', ''],
'reset_clear': ['Reset and clear terminal', ''], 'reset_clear': ['Reset and clear terminal', ''],
'title_tx_txt_color': ['Tx Title Foreground Color', ''],
'title_tx_bg_color': ['Tx Title Background Color', ''],
'title_rx_txt_color': ['Rx Title Foreground Color', ''],
'title_rx_bg_color': ['Rx Title Background Color', ''],
'title_ia_txt_color': ['Inactive Title Foreground Color', ''],
'title_ia_bg_color': ['Inactive Title Background Color', ''],
} }
# dictionary for results after setting # dictionary for results after setting
@ -183,6 +189,8 @@ class ProfileEditor:
x = 0 x = 0
widget.attach (gtk.ColorButton (gtk.gdk.color_parse (thing)), x, x + 1, y, y + 1) widget.attach (gtk.ColorButton (gtk.gdk.color_parse (thing)), x, x + 1, y, y + 1)
x += 1 x += 1
elif key in ['title_tx_txt_color', 'title_tx_bg_color', 'title_rx_txt_color', 'title_rx_bg_color', 'title_ia_txt_color', 'title_ia_bg_color']:
widget = gtk.ColorButton (gtk.gdk.color_parse (value))
elif key == 'background_image': elif key == 'background_image':
widget = gtk.FileChooserButton('Select a File') widget = gtk.FileChooserButton('Select a File')
filter = gtk.FileFilter() filter = gtk.FileFilter()

View File

@ -1282,11 +1282,25 @@ text/plain
notebookpage = self.terminator.get_first_notebook_page(notebookpage[0]) notebookpage = self.terminator.get_first_notebook_page(notebookpage[0])
def on_vte_focus_in(self, vte, event): def on_vte_focus_in(self, vte, event):
self._titlebox.modify_bg(gtk.STATE_NORMAL,self.terminator.window.get_style().bg[gtk.STATE_SELECTED]) for term in self.terminator.term_list:
if term != self and term._group != None and term._group == self._group:
term._title.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_rx_txt_color))
term._titlegroup.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_rx_txt_color))
term._titlebox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_rx_bg_color))
# set text to white
elif term != self and term._group == None or term._group != self._group:
term._title.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_ia_txt_color))
term._titlegroup.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_ia_txt_color))
term._titlebox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_ia_bg_color))
# set text to black
else:
term._title.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_tx_txt_color))
term._titlegroup.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_tx_txt_color))
term._titlebox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse (self.conf.title_tx_bg_color))
# set text to white
return return
def on_vte_focus_out(self, vte, event): def on_vte_focus_out(self, vte, event):
self._titlebox.modify_bg(gtk.STATE_NORMAL, self.terminator.window.get_style().bg[gtk.STATE_NORMAL])
return return
def on_vte_focus(self, vte): def on_vte_focus(self, vte):