Skip to content

Commit 59c8552

Browse files
committed
Introduce new gtk section to have gtk-specific configuration. We start with the font which gets passed into the FontDescription from pango
1 parent 35bf505 commit 59c8552

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

bpython/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def loadini(struct, configfile):
6464
'show_source': 'F2',
6565
'undo': 'C-r',
6666
'up_one_line': 'C-p',
67-
'yank_from_buffer': 'C-y'}})
67+
'yank_from_buffer': 'C-y'},
68+
'gtk': {
69+
'font': 'monospace 10'}})
6870
config.read(config_path)
6971

7072
struct.dedent_after = config.getint('general', 'dedent_after')
@@ -99,6 +101,8 @@ def loadini(struct, configfile):
99101
struct.pastebin_url = config.get('general', 'pastebin_url')
100102
struct.pastebin_show_url = config.get('general', 'pastebin_show_url')
101103

104+
struct.gtk_font = config.get('gtk', 'font')
105+
102106
color_scheme_name = config.get('general', 'color_scheme')
103107

104108
default_colors = {

bpython/gtk_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def __init__(self, interpreter, config):
260260
interpreter.writetb = self.writetb
261261
self.editing = Nested()
262262
self.reset_indent = False
263-
self.modify_font(pango.FontDescription('monospace 10'))
263+
self.modify_font(pango.FontDescription(self.config.gtk_font))
264264
self.set_wrap_mode(gtk.WRAP_CHAR)
265265
self.list_win = SuggestionWindow()
266266
self.list_win.connect('selection-changed',

0 commit comments

Comments
 (0)