Allow user configurability of the cursor colour. Patch from Jordan Callicoat. Closes LP #348231
This commit is contained in:
parent
bc65cbf751
commit
44e958f53e
@ -83,6 +83,10 @@ Default value: \fBescape\-sequence\fR
|
||||
Controls if the cursor blinks.
|
||||
Default value: \fBTrue\fR
|
||||
.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
|
||||
Sets what type of terminal should be emulated.
|
||||
Default value: \fBxterm\fR
|
||||
|
@ -71,6 +71,7 @@ Defaults = {
|
||||
'backspace_binding' : 'ascii-del',
|
||||
'delete_binding' : 'delete-sequence',
|
||||
'cursor_blink' : True,
|
||||
'cursor_color' : '',
|
||||
'emulation' : 'xterm',
|
||||
'font' : 'Mono 10',
|
||||
'foreground_color' : '#AAAAAA',
|
||||
|
@ -9,7 +9,7 @@ import gtk, gobject
|
||||
class ProfileEditor:
|
||||
# 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']
|
||||
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']
|
||||
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))
|
||||
elif key == 'background_color':
|
||||
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':
|
||||
colours = value.split (':')
|
||||
numcolours = len (colours)
|
||||
|
@ -673,6 +673,10 @@ text/plain
|
||||
palette.append (gtk.gdk.color_parse (color))
|
||||
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
|
||||
# Many thanks to the authors of gnome-terminal, on which this code is based.
|
||||
background_type = self.conf.background_type
|
||||
|
Loading…
Reference in New Issue
Block a user