-
-
Notifications
You must be signed in to change notification settings - Fork 30k
-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
IDLE: configdialog -- switch to ttk widgets. #74964
Comments
New PR replaces the custom TabbedPageSet with ttk.Notebook. On Windows, with default settings, the look is nearly identical, but the selected tab is more obvious. A method call (note.enable_traversal) will enable navigation between tabs with cntl-tab and cntl-shift-tab. This will work a bit better with extracted page classes. On the otherhand, attaching the frame to a notebook instead of the one disables one of the simulated mouse clicks. I added the remaining part of tkinter.test.support.simulate_click(sp??) to no avail (not surprising since designed for Xwindows. I also moved the location of the simulated click. Using ttk.Frame requires the padx, pady to padding change in PR2654. Please test on linuxes (and mac if possible). Does the tabset look at least as good? Does the test run if the #s are removed? |
Looks good under Ubuntu. The height of the window is longer, so everything is a bit stretched out. That helps on the Keys tab, but not so much on Highlights or Extensions. It's not awful, but there's unneeded (for now?) empty space. One thing that's different is that there is an initial focus selected on each tab when switching tabs, but then focus is lost when moving back to another tab. Example: When the config dialog is opened, focus is on the fonts, like it was after Louie's change. However, when I first click 'Keys', there is a box around 'Use a Built-in Key Set', even if it isn't selected. So, that's new (there was no focus before). When I then click back to 'Fonts', the fontlist doesn't have focus anymore. Before this change, fontlist still had focus after switching to another tab and then going back to fonts. Might be why the test isn't working. All the tests pass, but I get the error if I uncomment the helplist tests: Traceback (most recent call last):
File "/home/cheryl/cpython/Lib/idlelib/idle_test/test_configdialog.py", line 315, in test_source_selected
self.assertEqual(helplist.get('anchor'), 'source')
AssertionError: '' != 'source'
+ source |
I did not try to match the height in that commit. I wanted to see what would happen if we enlarge the dialog to accommodate more widgets. It is now about 10% larger. The highlight sample looks better with a bit more room. The font sample works better in that the box does not expand until it has to. The total size does not change. Focus traversal has been neglected on C.D., which is a bit of a bug. On the original, the focus disappears and comes back. On the notebook it visibly cycles around one tab, including the tab. I changed takefocus to True for fontlist and helplist. When focus is on a tab, Left and Right change tabs. With the enable call, Cntl_Tab and Cntl-Shift-Tab always work to change tabs. I decided to push this in spite of the test problem. It is easy to check that helplist clicking work on htest. Maybe fixing up and down on helplist, as done with fontlist, will somehow help. This is a usability bug, not a test bug. I should make the boxes identical before giving up. |
The 'this' in 'this is a usability bug' refers to the fact that up and down move the blue selection highlight but not the selection, so that delete does not necessarily delete what appears to be selected. |
I wonder if the usability bug is related to bpo-25684, even though it's a different widget. The reason I'm suggesting that is that I had converted the DynOptionMenu to be a ttk.OptionMenu in configdialog, but when I did that, that selection of a target tag on the highlight screen and the clicking of a target within highlight_sample didn't stay in sync, and that sounds very much like what it happening in helplist. My patch for 25684 fixed the reported issue, but also fixed what I was seeing in configdialog. |
I will check for anything even vaguely related. In any case, your comment reminded me to give your PR a boost. Too bad it will miss 3.5. |
I fixed the test problem by selecting the General page in the class setup with d.note.select(3). Then the focus_force to a widget on the page must have worked. |
I rebased my PR and updated the tests so that they would pass. I knew 'bg' on the frame would be changed, but I was surprised by the 'state' changes. 'normal' only exists for compatibility and isn't one of the states to check in the tests; instead, 'disabled' and '!disabled' set the state and either 'disabled' appears in the tuple or it doesn't appear. I suppose I could have changed the tests to be assertNotIn. https://docs.python.org/3/library/tkinter.ttk.html#widget-states |
Main effects on Windows:
Overall, a slight improvement even on Windows. We can tweak details when revising individual pages. The dynamic option menus look out of place, and should be replaced. |
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: