[New-bugs-announce] [issue7949] idle does not handle dark gtk color schemes

Mathias Panzenböck report at bugs.python.org
Wed Feb 17 03:01:53 CET 2010


New submission from Mathias Panzenböck <grosser.meister.morti at gmx.net>:

Idle sets *some* colors to hardcoded values and uses the system defaults for other colors. This is extremely bad when you use a dark gtk color scheme and now a almost white text (system text color) is displayed on a white background (idle tooltip background color).

There are two solutions to the problem: Also set the foreground color to a hardcoded value or better detect whether the foreground color is bright or dark and choose an appropriate background color. I've implemented the latter for the idle that comes with fedora 12 (2.6.2). I forgot to backup the original files so I can't make a diff/patch. However, I attached the changed files and here is a summary of my changes:

in idlelib/ToolTip.py:
added functions:
   parse_color(color)
   set_tooltip_bg(widget)

in ToolTipBase.showcontents():
   set_tooltip_bg(label)

in ListboxToolTip.showcontents():
   set_tooltip_bg(listbox)

in idlelib/AutoCompleteWindow.py:
added:
   from ToolTip import set_tooltip_bg

in AutoCompleteWindow.show_window():
   set_tooltip_bg(listbox)

in idlelib/CallTipWindow.py:
added:
   from ToolTip import set_tooltip_bg

in CallTip.showtip():
   set_tooltip_bg(self.label)

----------
components: IDLE
files: idlelib.zip
messages: 99457
nosy: panzi
severity: normal
status: open
title: idle does not handle dark gtk color schemes
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file16240/idlelib.zip

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7949>
_______________________________________


More information about the New-bugs-announce mailing list