-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Idle: improve idle.html help viewer. #69385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I just pushed the new viewer as part of bpo-16893. Possible improvements:
|
List indent glitch: In the command line section, after the box, idle.rst has If there are arguments: #. If Firefox shows this as (but does not allow copying of '1. ') If there are arguments:
The help window shows this, for example, (but not copy indent) as If there are arguments:
The point is not '1. ' versus '* ', this being the only place where idle.rst uses '#' for a list (and I changed this). The problem is the dedent of the second line. This only occurs if the second line starts with a font change. If I narrow the window so it begins with 'to', the line is indented properly. Narrow further so it begins with 'sys', no ident. I am pretty sure I have not touched your indent code. Any ideas on how to fix? or a tk glitch? |
Have attached help-indent-fix.patch. Basically the parser is very fragile when it comes to combining tags, so the handling of the 'span .pre' was stomping on the indent tag. Separated out handling of character level tags (e.g. italic) from block level tags (e.g. lists, headings). |
New changeset 8b3dc527a62c by Terry Jan Reedy in branch '2.7': New changeset 1d0f4b94066b by Terry Jan Reedy in branch '3.4': |
Fixed. I added a light background as with Sphinx html. I am delighted with how well this is working so far. I like the little always-there [TOC] button better than the browser sidebar. Besides making it easy to verify the look of doc changes, I think it looks better. I like the appearance of the tk version, without the down arrow, a bit better than the ttk version with an arrow, but would switch, when possible, if there were functional reason (see below). To improve the button: I want to add an activebackground (or foreground) so when moused over, the button is more obviously a live button to be pushed. Any particular suggestion? Is there a standard? Or do I worry too much? Idle buttons don't change when moused over, but they have relief to convey 'push me'. So that people can navigate without mouse, I tested adding takefocus=True to toc creation, takefocus=False to text, and toc.focus_set(). <space> (and <click>), <enter>, and <esc> work as expected. However the tk Menubutton (but not ttk version) seems to have a bug (at least here, ). After <space>, it is left in a 'pressed' state, with a black outline, while the menu is displayed, and after. (With <click> the outline and menu appear on button-press and the outline disappears on button-release, while the menu remains.) A click on the button is required to reset it and remove the outline. Then either <space> or <click> work as before. I tried an expanded command function to reset toc, |
Another minor glitch: in a browser, each press of up or down arrow, when there is no cursor (after clicking outside of an entry box like this one), moves text up or down. (3 lines for me in FF, even though wheel click moved more) In an editor, each press moves the *cursor* up or down one line, and text only moves when the cursor is at the top or bottom of the window. The read-only text has an invisible cursor, which one must invisibly move to top or bottom before anything happens. Some of the code with bpo-17535 might help, but not looking now. Another enhancement: use user set Initial Window size. |
New changeset c1eccae07977 by Terry Jan Reedy in branch '2.7': New changeset 1c119da20663 by Terry Jan Reedy in branch '3.4': |
Had to adjust number of line by 3/4 because average 4/3 as high as in editor due to taller header lines and extra interline spacing. Net result for me, using 12 pitch in editor also, is box size within 5%. |
New changeset 40bab637295d by Terry Jan Reedy in branch '2.7': New changeset 5b635a3ca3d5 by Terry Jan Reedy in branch '3.4': |
By reading http://www.tcl.tk/man/tcl8.6/TkCmd/text.htm I discovered that Text.yview(index) puts the line with index at the top of the windows, given enough line below to fill the window. This fixes another glitch. Still left: the original 3 items (msg251181), navigating the text with up and down arrow (msg251571), and operating TOC button with keyboard (msg251556). |
Good catch about yview for text widgets! |
I've created PR6665 for the first bullet item.
|
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: