feat(prefs): add prefs UI for bold_is_bright option (#38)

This commit is contained in:
Jakub Vaněk 2020-04-25 20:22:51 +02:00
parent 02542bbc3f
commit 7ea105492f
No known key found for this signature in database
GPG Key ID: CCDE818F3F894D36
2 changed files with 26 additions and 0 deletions

View File

@ -2639,6 +2639,24 @@
<property name="top_attach">1</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="bold_text_is_bright_checkbutton">
<property name="label" translatable="yes">Show b_old text in bright colors</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="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_bold_text_is_bright_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">2</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>

View File

@ -516,6 +516,9 @@ class PrefsEditor:
# Use system colors # Use system colors
widget = guiget('use_theme_colors_checkbutton') widget = guiget('use_theme_colors_checkbutton')
widget.set_active(self.config['use_theme_colors']) widget.set_active(self.config['use_theme_colors'])
# Bold is bright
widget = guiget('bold_text_is_bright_checkbutton')
widget.set_active(self.config['bold_is_bright'])
# Colorscheme # Colorscheme
widget = guiget('color_scheme_combobox') widget = guiget('color_scheme_combobox')
scheme = None scheme = None
@ -1500,6 +1503,11 @@ class PrefsEditor:
self.config['use_theme_colors'] = active self.config['use_theme_colors'] = active
self.config.save() self.config.save()
def on_bold_text_is_bright_checkbutton_toggled(self, widget):
"""Bold-is-bright setting changed"""
self.config['bold_is_bright'] = widget.get_active()
self.config.save()
def on_cellrenderer_accel_edited(self, liststore, path, key, mods, _code): def on_cellrenderer_accel_edited(self, liststore, path, key, mods, _code):
"""Handle an edited keybinding""" """Handle an edited keybinding"""
celliter = liststore.get_iter_from_string(path) celliter = liststore.get_iter_from_string(path)