Allow user configurability of the cursor colour. Patch from Jordan Callicoat. Closes LP #348231

This commit is contained in:
Chris Jones 2009-03-25 12:48:27 +00:00
parent bc65cbf751
commit 44e958f53e
4 changed files with 14 additions and 1 deletions

View File

@ -83,6 +83,10 @@ Default value: \fBescape\-sequence\fR
Controls if the cursor blinks. Controls if the cursor blinks.
Default value: \fBTrue\fR Default value: \fBTrue\fR
.TP .TP
.B cursor_color
Default colour of cursor, as a colour specification (can be HTML-style hex digits, or a colour name such as "red").
Default value: Current value of \fBforeground_color\fR
.TP
.B emulation .B emulation
Sets what type of terminal should be emulated. Sets what type of terminal should be emulated.
Default value: \fBxterm\fR Default value: \fBxterm\fR

View File

@ -71,6 +71,7 @@ Defaults = {
'backspace_binding' : 'ascii-del', 'backspace_binding' : 'ascii-del',
'delete_binding' : 'delete-sequence', 'delete_binding' : 'delete-sequence',
'cursor_blink' : True, 'cursor_blink' : True,
'cursor_color' : '',
'emulation' : 'xterm', 'emulation' : 'xterm',
'font' : 'Mono 10', 'font' : 'Mono 10',
'foreground_color' : '#AAAAAA', 'foreground_color' : '#AAAAAA',

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', 'audible_bell', 'visible_bell', 'urgent_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', 'audible_bell', 'visible_bell', 'urgent_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', 'cursor_color', 'palette']
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']
@ -172,6 +172,10 @@ class ProfileEditor:
widget = gtk.ColorButton (gtk.gdk.color_parse (value)) widget = gtk.ColorButton (gtk.gdk.color_parse (value))
elif key == 'background_color': elif key == 'background_color':
widget = gtk.ColorButton (gtk.gdk.color_parse (value)) widget = gtk.ColorButton (gtk.gdk.color_parse (value))
elif key == 'cursor_color':
if not value:
value = self.source_get_value ('foreground_color')
widget = gtk.ColorButton (gtk.gdk.color_parse (value))
elif key == 'palette': elif key == 'palette':
colours = value.split (':') colours = value.split (':')
numcolours = len (colours) numcolours = len (colours)

View File

@ -673,6 +673,10 @@ text/plain
palette.append (gtk.gdk.color_parse (color)) palette.append (gtk.gdk.color_parse (color))
self._vte.set_colors (fg_color, bg_color, palette) self._vte.set_colors (fg_color, bg_color, palette)
cursor_color = self.conf.cursor_color
if cursor_color != '':
self._vte.set_color_cursor (gtk.gdk.color_parse (cursor_color))
# Set our background image, transparency and type # Set our background image, transparency and type
# Many thanks to the authors of gnome-terminal, on which this code is based. # Many thanks to the authors of gnome-terminal, on which this code is based.
background_type = self.conf.background_type background_type = self.conf.background_type