python / cpython

The Python programming language
https://www.python.org
Other
63.38k stars 30.35k forks source link

IDLE themes for light on dark #69008

Closed f4315b71-14d3-4c16-bb7a-6534e5fa1d04 closed 9 years ago

f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago
BPO 24820
Nosy @terryjreedy, @kbkaiser, @serwy, @roseman
Files
  • config-highlight.cfg
  • idle-dark.cfg
  • breakpoint-prefs.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/terryjreedy' closed_at = created_at = labels = ['expert-IDLE', 'type-feature'] title = 'IDLE themes for light on dark' updated_at = user = 'https://github.com/roseman' ``` bugs.python.org fields: ```python activity = actor = 'markroseman' assignee = 'terry.reedy' closed = True closed_date = closer = 'terry.reedy' components = ['IDLE'] creation = creator = 'markroseman' dependencies = [] files = ['40570', '40634', '40635'] hgrepos = [] issue_num = 24820 keywords = ['patch'] message_count = 22.0 messages = ['248177', '248220', '248225', '251550', '251563', '251588', '251607', '251614', '251621', '251624', '251645', '251646', '251970', '251975', '251979', '251981', '252186', '252187', '252255', '252256', '252259', '252279'] nosy_count = 7.0 nosy_names = ['terry.reedy', 'kbk', 'roger.serwy', 'markroseman', 'python-dev', 'Anand Krishnakumar', 'jayseye'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue24820' versions = ['Python 2.7', 'Python 3.4', 'Python 3.5', 'Python 3.6'] ```

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    If there are going to be highlighting themes in IDLE, and the ability to customize them, why not the background color of the window? Light on dark is easier for some people to read - adding one that did that would be a good candidate for another built-in theme. Also many people (myself included) tend to use a light color other than white for editors, terminals, etc.

    terryjreedy commented 9 years ago

    This looks like mostly a duplicate of bpo-7949. Can you differentiate?

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    I read bpo-7949 as saying the text widget picks up the background color from the system-wide GTk theme.

    This one is saying that the background color of the text widget should be changeable as part of an IDLE highlighting theme.

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    I wrote a short utility that parses TextMate XML-based theme files (which are also used by Sublime) and converts them into something IDLE can use. It's not a perfect match, because IDLE's themes are more restrictive, but it's not bad.

    I'm attaching the output of the script (config-highlight.cfg), which was able to translate 17 themes. A few are kind of yucky, and they all need some tweaking for selection and shell colors, but it's not a bad place to start...

    terryjreedy commented 9 years ago

    I re-read bpo-7949 and read the problem as mixing a hard-coded (by tk or Idle is not clear) background (white) with a system-default foreground, which is also white when the system background is black. Hence the screenshot in duplicate bpo-16984. In any case, that issue is complementary to this one, about user-configured tagged text colors.

    Parsing an existing format is an interesting idea. Most of the variations seem pointless, but I like the cobalt one as a basis for a dark theme. I plan to improve it, using current Idle (Classic and New seem the same, so why two?), with my changes. I will upload when I have something I like.

    The change I made is to color the backgrounds of 'shell', 'stdout', and 'stderr' light yellow, light blue, and light red. These changes work so well for me, at least, that I have thought of adding them to an 'Idle New' that is really new and different. But transitions are hard. The main other thing I don't like in 'Idle ???' is the orange for keywords, as too 'different' from the purple and blue of builtings and defined. But green is semi standard for strings and that does not leave room for three colors on the blue side.

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    Sounds good. I agree picking a few and tweaking them would be a good way forward (and incidentally, the 'Cobalt' theme is the one I use in my regular editor!)

    terryjreedy commented 9 years ago

    For me, Idle comes with one light theme, under 2 names. I don't know what happens on Mac. Let us add one dark theme as Idle Dark, before 3.4.4 if possible.

    We can later consider whether to add more light and dark built-in themes. But I think more important would be to add the ability to change at once the background of all elements that use the default (normal) background. I believe you have mentioned that one might want to change white to an off-white. Cobalt is an off-black, but someone might prefer black black, or the slightly bluer background of Windows Power Shell. We should not have multiple themes just for background variations.

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    Ok, do you want to add the dark theme in then? I'll add some code to the ttk based preferences dialog (for when that gets in) to give the user the option of applying the new background color to all the other elements which had the same original background color.

    terryjreedy commented 9 years ago

    Here is an Idle Dark theme that is the near-inverse of the standard Idle theme, with foreground colors tweaked just a bit to account for the background switch and its blue tint. It otherwise retains the current color mapping. What do you think?

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    Looks good to me!

    310b7da2-958b-40aa-9efc-93aa78ef0865 commented 9 years ago

    Hi! I'm a 14 year old who wants to start developing for Python. I absolutely adore this enhancement and I would love to contribute towards this. So please let me know if I can help, and if yes, how?

    terryjreedy commented 9 years ago

    My only question right now is whether I should apply as is or with minor adjustments. Thanks for the encouragements either way.

    7e395118-8d2c-4c82-9676-5093b658e342 commented 9 years ago

    Greetings from an idle-dev 'lurker.' Has anyone tested the new dark theme with a Set Breakpoint command? The dark theme is great for me except for this quirk: breakpoints are invisible on my test box. Under the Classic light scheme breakpoints appear on a bright yellow background.

    Appreciate all the interest and work going into idle these days. I'll add any needed details on request. For starters I'm just wondering whether breakpoints have yet to be tested with this dark theme.

    Thanks, jayseye (Marc Paul Rubin)

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    Hi Marc, you're correct that is an error in the theme. To correct it, change the setting for 'break-background' to be something like bpo-666622. Thanks!

    terryjreedy commented 9 years ago

    Marc, thanks for unlurking. I like something a bit brighter, such as bpo-808000, though it does not matter much in this color area. We are revising the highlight tab and should add a line [ breakpoint ] to the sample box.

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    Attached a patch to the current config dialog to add breakpoint to the window, and have updated the same thing in my newer dialog.

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 9 years ago

    New changeset e67da755d614 by Terry Jan Reedy in branch '2.7': Issue bpo-24820: Users can now set breakpoint colors in Settings -> https://hg.python.org/cpython/rev/e67da755d614

    New changeset d874a6157223 by Terry Jan Reedy in branch '3.4': Issue bpo-24820: Users can now set breakpoint colors in Settings -> https://hg.python.org/cpython/rev/d874a6157223

    terryjreedy commented 9 years ago

    I was going to push both a version of the breakpoint patch and the new theme, but noticed a problem. If someone selects IDLE Dark and saves that choice and then run an older Python+IDLE, then the older IDLE will not find 'IDLE Dark' and will run a backup default black and white theme, possibly with some error messages. The solution is to select IDLE Dark and then immediately hit [Save as New Custom Theme] and enter a different name. IDLE will then change Select: from (o) a Built-in Theme to (o) a Custom Theme, with the saved name selected. I want to add a popup to say this before adding the theme.

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 9 years ago

    New changeset afa95f032de1 by Terry Jan Reedy in branch '2.7': Issue bpo-24820: Add 'IDLE Dark' text color theme, warning, and solution. https://hg.python.org/cpython/rev/afa95f032de1

    New changeset 1de01a63f360 by Terry Jan Reedy in branch '3.4': Issue bpo-24820: Add 'IDLE Dark' text color theme, warning, and solution. https://hg.python.org/cpython/rev/1de01a63f360

    terryjreedy commented 9 years ago

    See patch for message. Merely displaying a message, and not trying to do anything fancy, like cancelling the selection, avoids any possible problem in interaction with other methods. I leave it to users to decide if action is needed, and if so, whether to switch or save as custom.

    Mark's original post had two issues. The first, a dark background theme, is now committed and this issue closed. Thanks for the push for something requested by others. I am using it myself.

    The second, the ability to simultaneously change all default backgrounds, such as white to off-white, is or will be either a new issue or part of the highlight tab rewrite, bpo-24781.

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 9 years ago

    New changeset 739cc9ca55cd by Terry Jan Reedy in branch '2.7': Issue bpo-24820: Update IDLE NEWS items. https://hg.python.org/cpython/rev/739cc9ca55cd

    New changeset 233974dfda03 by Terry Jan Reedy in branch '3.4': Issue bpo-24820: Update IDLE NEWS items. https://hg.python.org/cpython/rev/233974dfda03

    New changeset 89a1e03b4639 by Terry Jan Reedy in branch '3.5': Issue bpo-24820: Update IDLE NEWS items. https://hg.python.org/cpython/rev/89a1e03b4639

    f4315b71-14d3-4c16-bb7a-6534e5fa1d04 commented 9 years ago

    FYI, the change multiple backgrounds thing is in my working version for the new dialog. Added new issue bpo-25313 to remind us that the warning message is something we'd love to get rid of in the future and as quickly as possible make it unnecessary if we add more new themes and/or new features in themes.