Title: IDLE: configdialog -- switch to ttk widgets.
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.7, Python 3.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: csabella, terry.reedy
Priority: normal Keywords:

Created on 2017-06-26 22:47 by terry.reedy, last changed 2017-09-11 03:25 by terry.reedy. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2654 merged csabella, 2017-07-11 00:46
PR 2938 merged terry.reedy, 2017-07-28 23:17
PR 2944 merged terry.reedy, 2017-07-29 04:51
PR 3214 merged terry.reedy, 2017-08-26 18:27
PR 3215 open csabella, 2017-08-26 23:16
PR 3238 merged csabella, 2017-08-29 18:44
PR 3489 merged python-dev, 2017-09-11 02:41
Messages (17)
msg296964 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-26 22:47
Change imports and see what else needs fixing.
#27755 is one specific ttk switch that could be done before, as part of, or after this.

This issue depends on #30780 test GUI
msg299440 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-28 23:34
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 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?
msg299441 - (view) Author: Cheryl Sabella (csabella) * Date: 2017-07-29 00:12
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:
FAIL: test_source_selected (idlelib.idle_test.test_configdialog.GeneralTest)
Traceback (most recent call last):
  File "/home/cheryl/cpython/Lib/idlelib/idle_test/", line 315, in test_source_selected
    self.assertEqual(helplist.get('anchor'), 'source')
AssertionError: '' != 'source'
+ source

msg299451 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-29 04:19
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.
msg299453 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-29 04:49
New changeset b331f80b4765c3201674a7ca8b35c9d4a65efe79 by Terry Jan Reedy in branch 'master':
bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (#2938)
msg299454 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-29 04:58
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.
msg299455 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-29 05:28
New changeset 8364feff6730f54063116b607605167d9027ce85 by Terry Jan Reedy in branch '3.6':
[3.6] bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (GH-2938) (#2944)
msg299464 - (view) Author: Cheryl Sabella (csabella) * Date: 2017-07-29 11:28
I wonder if the usability bug is related to issue25684, 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.
msg299481 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-29 18:36
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.
msg299491 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-30 03:47
I fixed the test problem by selecting the General page in the class setup with  Then the focus_force to a widget on the page must have worked.
msg300812 - (view) Author: Cheryl Sabella (csabella) * Date: 2017-08-24 23:05
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.
msg300890 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-08-26 18:26
New changeset 7028e5986fceeeb73dffb5d5bf8f03d88f73b63d by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
bpo-30781: IDLE -  use ttk widgets in configdialog (#2654)
msg300903 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-08-26 20:12
New changeset 7b556025ff7d663233e7fcb84785eb071f5e2ba7 by Terry Jan Reedy in branch '3.6':
[3.6] bpo-30781: IDLE -  use ttk widgets in configdialog (GH-2654) (#3214)
msg300905 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-08-26 20:14
Main effects on Windows:
* Label in LabelFrame is blue.
* Widget frames turn blue when target by mouse.  (This is especially nice for checkbuttons, where the visible 'frame' is the circle, while the mouse just needs to be inside the invisible actual frame that includes the circle and label.)
* Button flat (I know that we could restore 'old-fashioned' relief with explicit styles) and sometimes larger.
Font sample left-justified instead of centered.  No necessarily bad.

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.
msg301848 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-11 02:41
New changeset 3866d9bbcf808cea98b3d00007f9f246b83858ce by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
bpo-30781: IDLE: Fix help button on configdialog (#3238)
msg301852 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-11 03:19
New changeset 4a8b53a2083506ee13ff2eba2c14264f5a7faa91 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-30781: IDLE: Fix help button on configdialog (GH-3238) (#3489)
msg301853 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-11 03:25
I moved PR3215 to #27755.  So this issue is really closed.
Date User Action Args
2017-09-11 03:25:25terry.reedysetmessages: + msg301853
2017-09-11 03:19:37terry.reedysetmessages: + msg301852
2017-09-11 02:41:23python-devsetpull_requests: + pull_request3481
2017-09-11 02:41:12terry.reedysetmessages: + msg301848
2017-08-29 18:44:26csabellasetpull_requests: + pull_request3280
2017-08-26 23:16:09csabellasetpull_requests: + pull_request3254
2017-08-26 20:14:28terry.reedysetstatus: open -> closed
messages: + msg300905

dependencies: - IDLE: configdialog - add tests for ConfigDialog GUI.
resolution: fixed
stage: test needed -> resolved
2017-08-26 20:12:16terry.reedysetmessages: + msg300903
2017-08-26 18:27:26terry.reedysetpull_requests: + pull_request3252
2017-08-26 18:26:04terry.reedysetmessages: + msg300890
2017-08-24 23:05:39csabellasetmessages: + msg300812
2017-07-30 03:47:30terry.reedysetmessages: + msg299491
2017-07-29 18:36:44terry.reedysetmessages: + msg299481
2017-07-29 11:28:16csabellasetmessages: + msg299464
2017-07-29 05:28:07terry.reedysetmessages: + msg299455
2017-07-29 04:58:36terry.reedysetmessages: + msg299454
2017-07-29 04:51:39terry.reedysetpull_requests: + pull_request2993
2017-07-29 04:49:41terry.reedysetmessages: + msg299453
2017-07-29 04:19:31terry.reedysetmessages: + msg299451
2017-07-29 00:12:20csabellasetnosy: + csabella
messages: + msg299441
2017-07-28 23:34:56terry.reedysetmessages: + msg299440
2017-07-28 23:17:04terry.reedysetpull_requests: + pull_request2990
2017-07-11 00:46:41csabellasetpull_requests: + pull_request2719
2017-06-30 22:38:18terry.reedylinkissue27099 dependencies
2017-06-27 00:46:41terry.reedylinkissue30728 dependencies
2017-06-26 22:47:38terry.reedysetdependencies: + IDLE: configdialog - add tests for ConfigDialog GUI.
2017-06-26 22:47:15terry.reedycreate