Skip to content
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

Closed
terryjreedy opened this issue Jun 26, 2017 · 19 comments
Closed

IDLE: configdialog -- switch to ttk widgets. #74964

terryjreedy opened this issue Jun 26, 2017 · 19 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

BPO 30781
Nosy @terryjreedy, @csabella
PRs
  • bpo-30781: IDLE - use ttk widgets in configdialog #2654
  • bpo-30781: IDLE - Use ttk Notebook in ConfigDialog #2938
  • [3.6] bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (GH-2938) #2944
  • [3.6] bpo-30781: IDLE - use ttk widgets in configdialog (GH-2654) #3214
  • bpo-27755: IDLE: Convert configdialog DynOptionMenu to ttk OptionMenu #3215
  • bpo-30781: IDLE: Fix help button on configdialog #3238
  • [3.6] bpo-30781: IDLE: Fix help button on configdialog (GH-3238) #3489
  • bpo-30781: Remove unused imports in idlelib.configdialog. #4627
  • [3.6] bpo-30781: Remove unused imports in idlelib.configdialog. (GH-4627) #4630
  • 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:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2017-08-26.20:14:28.308>
    created_at = <Date 2017-06-26.22:47:15.903>
    labels = ['expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: configdialog -- switch to ttk widgets.'
    updated_at = <Date 2017-11-29.03:46:38.273>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2017-11-29.03:46:38.273>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2017-08-26.20:14:28.308>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2017-06-26.22:47:15.903>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30781
    keywords = []
    message_count = 19.0
    messages = ['296964', '299440', '299441', '299451', '299453', '299454', '299455', '299464', '299481', '299491', '300812', '300890', '300903', '300905', '301848', '301852', '301853', '307201', '307207']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'cheryl.sabella']
    pr_nums = ['2654', '2938', '2944', '3214', '3215', '3238', '3489', '4627', '4630']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30781'
    versions = ['Python 3.6', 'Python 3.7']

    @terryjreedy
    Copy link
    Member Author

    Change imports and see what else needs fixing.
    bpo-27755 is one specific ttk switch that could be done before, as part of, or after this.

    This issue depends on bpo-30780 test GUI

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jun 26, 2017
    @terryjreedy terryjreedy self-assigned this Jun 26, 2017
    @terryjreedy terryjreedy added topic-IDLE type-feature A feature request or enhancement labels Jun 26, 2017
    @terryjreedy
    Copy link
    Member Author

    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?

    @csabella
    Copy link
    Contributor

    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/test_configdialog.py", line 315, in test_source_selected
        self.assertEqual(helplist.get('anchor'), 'source')
    AssertionError: '' != 'source'
    + source

    @terryjreedy
    Copy link
    Member Author

    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.

    @terryjreedy
    Copy link
    Member Author

    New changeset b331f80 by Terry Jan Reedy in branch 'master':
    bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (bpo-2938)
    b331f80

    @terryjreedy
    Copy link
    Member Author

    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.

    @terryjreedy
    Copy link
    Member Author

    New changeset 8364fef by Terry Jan Reedy in branch '3.6':
    [3.6] bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (GH-2938) (bpo-2944)
    8364fef

    @csabella
    Copy link
    Contributor

    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.

    @terryjreedy
    Copy link
    Member Author

    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.

    @terryjreedy
    Copy link
    Member Author

    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.

    @csabella
    Copy link
    Contributor

    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

    @terryjreedy
    Copy link
    Member Author

    New changeset 7028e59 by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
    bpo-30781: IDLE - use ttk widgets in configdialog (bpo-2654)
    7028e59

    @terryjreedy
    Copy link
    Member Author

    New changeset 7b55602 by Terry Jan Reedy in branch '3.6':
    [3.6] bpo-30781: IDLE - use ttk widgets in configdialog (GH-2654) (bpo-3214)
    7b55602

    @terryjreedy
    Copy link
    Member Author

    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.

    @terryjreedy
    Copy link
    Member Author

    New changeset 3866d9b by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
    bpo-30781: IDLE: Fix help button on configdialog (bpo-3238)
    3866d9b

    @terryjreedy
    Copy link
    Member Author

    New changeset 4a8b53a by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
    [3.6] bpo-30781: IDLE: Fix help button on configdialog (GH-3238) (bpo-3489)
    4a8b53a

    @terryjreedy
    Copy link
    Member Author

    I moved PR3215 to bpo-27755. So this issue is really closed.

    @terryjreedy
    Copy link
    Member Author

    New changeset e8f7c78 by Terry Jan Reedy in branch 'master':
    bpo-30781: Remove unused imports in idlelib.configdialog. (bpo-4627)
    e8f7c78

    @terryjreedy
    Copy link
    Member Author

    New changeset a8de696 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
    bpo-30781: Remove unused imports in idlelib.configdialog. (GH-4627) (bpo-4630)
    a8de696

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants