Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix some minor color/style config issues in the qtconsole #1363

Merged
merged 4 commits into from Feb 8, 2012

Conversation

Projects
None yet
2 participants
Owner

minrk commented Feb 1, 2012

The tabbed code changed a few things about loading styles and stylesheets in the qtconsole, which this resolves, among a couple other small color-related issues:

  • tabs other than the first get colors
  • IPythonWidget.style_sheet configurable is not clobbered by defaults
  • style_sheet configurable would cause a crash, because _style_sheet_changed could be called before _control existed
  • fix str->unicode token preventing stylesheets without syntax highlighting from working
  • fix typo in the function used to detect whether a bgcolor is dark or light

minrk added some commits Feb 1, 2012

fix hex_to_rgb() used to guess light/dark in qtconsole
previously used 'r' for all 3 values
token passed to format_lines must be unicode, not str
otherwise a TypeError is raised in str.translate, since
unicode.translate takes a dict, while str.translate takes a bytestring
protect Widget._style_sheet_changed from being called before _control…
… exists

also ensure _control attributes start out as None, rather than undefined
adjust qtconsole color logic
* setting IPythonWidget.style_sheet is no longer clobbered by other
config or defaults.
* tabs other than the first get configured colors
Owner

ellisonbg commented Feb 2, 2012

I don't have Qt installed on this system, but the code looks good.

minrk added a commit that referenced this pull request Feb 8, 2012

Merge pull request #1363 from minrk/qtstyle
Fix some minor color/style config issues in the qtconsole

The tabbed code changed a few things about loading styles and stylesheets in the qtconsole, which this resolves, among a couple other small color-related issues:

* tabs other than the first get colors
* IPythonWidget.style_sheet configurable is not clobbered by defaults
* style_sheet configurable would cause a crash, because _style_sheet_changed could be called before _control existed
* fix str->unicode token preventing stylesheets without syntax highlighting from working
* fix typo in the function used to detect whether a bgcolor is dark or light

@minrk minrk merged commit 2b3bc44 into ipython:master Feb 8, 2012

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

Merge pull request #1363 from minrk/qtstyle
Fix some minor color/style config issues in the qtconsole

The tabbed code changed a few things about loading styles and stylesheets in the qtconsole, which this resolves, among a couple other small color-related issues:

* tabs other than the first get colors
* IPythonWidget.style_sheet configurable is not clobbered by defaults
* style_sheet configurable would cause a crash, because _style_sheet_changed could be called before _control existed
* fix str->unicode token preventing stylesheets without syntax highlighting from working
* fix typo in the function used to detect whether a bgcolor is dark or light
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment