Merge pull request #481 from Vulcalien/master

Move titlebar settings to profiles (#379)
This commit is contained in:
Matt Rose 2021-08-09 16:07:37 -04:00 committed by GitHub
commit 955ea09bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1247 additions and 1208 deletions

View File

@ -102,22 +102,12 @@ DEFAULTS = {
'use_custom_url_handler': False,
'custom_url_handler' : '',
'disable_real_transparency' : False,
'title_at_bottom' : False,
'title_hide_sizetext' : False,
'title_transmit_fg_color' : '#ffffff',
'title_transmit_bg_color' : '#c80003',
'title_receive_fg_color' : '#ffffff',
'title_receive_bg_color' : '#0076c9',
'title_inactive_fg_color' : '#000000',
'title_inactive_bg_color' : '#c0bebf',
'inactive_color_offset': 0.8,
'enabled_plugins' : ['LaunchpadBugURLHandler',
'LaunchpadCodeURLHandler',
'APTURLHandler'],
'suppress_multiple_term_dialog': False,
'always_split_with_profile': False,
'title_use_system_font' : True,
'title_font' : 'Sans 9',
'putty_paste_style' : False,
'putty_paste_style_source_clipboard': False,
'smart_copy' : True,
@ -126,6 +116,7 @@ DEFAULTS = {
'case_sensitive' : True,
'invert_search' : False,
'link_single_click' : False,
'title_at_bottom' : False
},
'keybindings': {
'zoom_in' : '<Control>plus',
@ -262,7 +253,17 @@ DEFAULTS = {
'http_proxy' : '',
'ignore_hosts' : ['localhost','127.0.0.0/8','*.local'],
'background_image' : '',
'background_alpha' : 0.0
'background_alpha' : 0.0,
# Titlebar
'title_hide_sizetext' : False,
'title_transmit_fg_color' : '#ffffff',
'title_transmit_bg_color' : '#c80003',
'title_receive_fg_color' : '#ffffff',
'title_receive_bg_color' : '#0076c9',
'title_inactive_fg_color' : '#000000',
'title_inactive_bg_color' : '#c0bebf',
'title_use_system_font' : True,
'title_font' : 'Sans 9'
},
},
'layouts': {

File diff suppressed because it is too large Load Diff

View File

@ -333,9 +333,6 @@ class PrefsEditor:
#Show on all workspaces
widget = guiget('stickycheck')
widget.set_active(self.config['sticky'])
#Hide size text from the title bar
widget = guiget('title_hide_sizetextcheck')
widget.set_active(self.config['title_hide_sizetext'])
# title bar at bottom
widget = guiget('title_at_bottom_checkbutton')
@ -359,19 +356,6 @@ class PrefsEditor:
# Clear selection on copy
widget = guiget('clear_select_on_copy')
widget.set_active(self.config['clear_select_on_copy'])
#Titlebar font selector
# Use system font
widget = guiget('title_system_font_checkbutton')
widget.set_active(self.config['title_use_system_font'])
self.on_title_system_font_checkbutton_toggled(widget)
# Font selector
widget = guiget('title_font_selector')
if self.config['title_use_system_font'] == True:
fontname = self.config.get_system_prop_font()
if fontname is not None:
widget.set_font_name(fontname)
else:
widget.set_font_name(self.config['title_font'])
## Profile tab
# Populate the profile list
@ -615,12 +599,6 @@ class PrefsEditor:
# Now set the palette selector widget
widget = guiget('palette_combobox')
widget.set_active(self.palettevalues[palette])
# Titlebar colors
for bit in ['title_transmit_fg_color', 'title_transmit_bg_color',
'title_receive_fg_color', 'title_receive_bg_color',
'title_inactive_fg_color', 'title_inactive_bg_color']:
widget = guiget(bit)
widget.set_color(Gdk.color_parse(self.config[bit]))
# Inactive terminal shading
widget = guiget('inactive_color_offset')
widget.set_value(float(self.config['inactive_color_offset']))
@ -716,6 +694,29 @@ class PrefsEditor:
if encoding[1] == value:
widget.set_active_iter(rowiter)
## Titlebar tab
# Titlebar colors
for bit in ['title_transmit_fg_color', 'title_transmit_bg_color',
'title_receive_fg_color', 'title_receive_bg_color',
'title_inactive_fg_color', 'title_inactive_bg_color']:
widget = guiget(bit)
widget.set_color(Gdk.color_parse(self.config[bit]))
# Hide size text from the title bar
widget = guiget('title_hide_sizetextcheck')
widget.set_active(self.config['title_hide_sizetext'])
# Use system font
widget = guiget('title_system_font_checkbutton')
widget.set_active(self.config['title_use_system_font'])
self.on_title_system_font_checkbutton_toggled(widget)
# Font selector
widget = guiget('title_font_selector')
if self.config['title_use_system_font'] == True:
fontname = self.config.get_system_prop_font()
if fontname is not None:
widget.set_font_name(fontname)
else:
widget.set_font_name(self.config['title_font'])
def set_layout(self, layout_name):
"""Set a layout"""
self.layouteditor.set_layout(layout_name)