Add the ability to deactivate extra theme dependant styling

This commit is contained in:
Stephen Boddy 2016-12-12 12:27:56 +01:00
parent bc58a400c7
commit 0bd8af4304
4 changed files with 79 additions and 54 deletions

View File

@ -94,6 +94,7 @@ DEFAULTS = {
'geometry_hinting' : False,
'window_state' : 'normal',
'borderless' : False,
'extra_styling' : True,
'tab_position' : 'top',
'broadcast_default' : 'group',
'close_button_on_tab' : True,

View File

@ -355,10 +355,8 @@
</object>
<object class="GtkDialog" id="prefswin">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Terminator Preferences</property>
<property name="default_width">640</property>
<property name="default_height">400</property>
<property name="type_hint">normal</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog_vbox1">
@ -849,6 +847,36 @@
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkCheckButton" id="winbordercheck">
<property name="label" translatable="yes">Window borders</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_winbordercheck_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label30">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Unfocused terminal font brightness:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
@ -858,23 +886,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="handlesize_value_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">-1</property>
<property name="justify">right</property>
<property name="width_chars">5</property>
<property name="max_width_chars">5</property>
<property name="lines">1</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
@ -893,34 +905,6 @@
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label30">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Unfocused terminal font brightness:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="inactive_color_offset_value_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">100%</property>
<property name="justify">right</property>
<property name="width_chars">5</property>
<property name="max_width_chars">5</property>
<property name="lines">1</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
@ -940,24 +924,56 @@
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="handlesize_value_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">-1</property>
<property name="justify">right</property>
<property name="width_chars">5</property>
<property name="max_width_chars">5</property>
<property name="lines">1</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="winbordercheck">
<property name="label" translatable="yes">Window borders</property>
<object class="GtkLabel" id="inactive_color_offset_value_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">100%</property>
<property name="justify">right</property>
<property name="width_chars">5</property>
<property name="max_width_chars">5</property>
<property name="lines">1</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="extrastylingcheck">
<property name="label" translatable="yes">Extra Styling (Theme dependant)</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_winbordercheck_toggled" swapped="no"/>
<signal name="toggled" handler="on_extrastylingcheck_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="top_attach">0</property>
<property name="width">3</property>
</packing>
</child>

View File

@ -254,6 +254,9 @@ class PrefsEditor:
# Window borders
widget = guiget('winbordercheck')
widget.set_active(not self.config['borderless'])
# Extra styling
widget = guiget('extrastylingcheck')
widget.set_active(self.config['extra_styling'])
# Tab bar position
option = self.config['tab_position']
widget = guiget('tabposcombo')
@ -692,6 +695,11 @@ class PrefsEditor:
self.config['borderless'] = not widget.get_active()
self.config.save()
def on_extrastylingcheck_toggled(self, widget):
"""Extra styling setting changed"""
self.config['extra_styling'] = widget.get_active()
self.config.save()
def on_hidefromtaskbcheck_toggled(self, widget):
"""Hide from taskbar setting changed"""
self.config['hide_from_taskbar'] = widget.get_active()

View File

@ -467,7 +467,7 @@ class Terminator(Borg):
theme_name = self.gtk_settings.get_property('gtk-theme-name')
theme_part_list = ['terminator.css']
if 1: # checkbox_style - needs adding to prefs
if self.config['extra_styling']: # checkbox_style - needs adding to prefs
theme_part_list.append('terminator_styling.css')
for theme_part_file in theme_part_list:
for theme_dir in [usr_theme_dir, app_theme_dir]: