Skip to content

Commit c238ddd

Browse files
committed
The background color of the ReplWidget is now read from the .theme file, the default d attribute translates to black as that is the default which is used in bpython.cli
1 parent 3eb52b1 commit c238ddd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bpython/gtk_.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343

4444
_COLORS = dict(b='blue', c='cyan', g='green', m='magenta', r='red',
45-
w='white', y='yellow', k='black')
45+
w='white', y='yellow', k='black', d='black')
4646

4747

4848
class ArgspecFormatter(object):
@@ -263,6 +263,9 @@ def __init__(self, interpreter, config):
263263
self.list_win.connect('selection-changed',
264264
self.on_suggestion_selection_changed)
265265
self.list_win.hide()
266+
267+
self.modify_base('normal', gtk.gdk.color_parse(_COLORS[self.config.color_scheme['background']]))
268+
266269
self.text_buffer = self.get_buffer()
267270
tags = dict()
268271
for (name, value) in self.config.color_scheme.iteritems():
@@ -634,13 +637,15 @@ def main(args=None):
634637
window = gtk.Window()
635638

636639
# branding
640+
641+
# fix icon to be distributed and loaded from the correct path
637642
icon = gtk.gdk.pixbuf_new_from_file('/home/simon/src/bpython/data/logo.png')
638643

639644
window.set_title('bpython')
640645
window.set_icon(icon)
641646
window.resize(600, 300)
642647

643-
repl_widget.modify_base('normal', gtk.gdk.Color(0, 0, 0))
648+
# read from config
644649

645650
sw = gtk.ScrolledWindow()
646651
sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)

0 commit comments

Comments
 (0)