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: Fix Font sample (config dialog) geometry #81809

Closed
rhettinger opened this issue Jul 19, 2019 · 11 comments
Closed

IDLE: Fix Font sample (config dialog) geometry #81809

rhettinger opened this issue Jul 19, 2019 · 11 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@rhettinger
Copy link
Contributor

BPO 37628
Nosy @rhettinger, @terryjreedy, @taleinat, @miss-islington, @aeros
PRs
  • bpo-37628: Fix IDLE config sample sizes #14958
  • [3.7] bpo-37628: Fix IDLE config sample sizes (GH-14958) #14980
  • [3.8] bpo-37628: Fix IDLE config sample sizes (GH-14958) #14981
  • 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 2019-07-28.06:00:06.971>
    created_at = <Date 2019-07-19.07:32:32.089>
    labels = ['3.8', 'expert-IDLE', 'type-bug', '3.7', '3.9']
    title = 'IDLE: Fix Font sample (config dialog) geometry'
    updated_at = <Date 2019-07-28.06:00:06.969>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2019-07-28.06:00:06.969>
    actor = 'taleinat'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2019-07-28.06:00:06.971>
    closer = 'taleinat'
    components = ['IDLE']
    creation = <Date 2019-07-19.07:32:32.089>
    creator = 'rhettinger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37628
    keywords = ['patch']
    message_count = 11.0
    messages = ['348150', '348460', '348464', '348476', '348488', '348549', '348550', '348551', '348560', '348561', '348572']
    nosy_count = 5.0
    nosy_names = ['rhettinger', 'terry.reedy', 'taleinat', 'miss-islington', 'aeros']
    pr_nums = ['14958', '14980', '14981']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37628'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @rhettinger
    Copy link
    Contributor Author

    The "font sample" bar on the General tab in Preferences is problematio. With some font sizes, it grows so large that there is no way to mouse downward to click "accept". Making the window smaller and perhaps only showing one or two samples would be a big win.

    Also consider having the window off by default and having a button to turn make it visible. I've need seen a single user benefit from this garish display.

    @rhettinger rhettinger added 3.8 only security fixes 3.9 only security fixes labels Jul 19, 2019
    @terryjreedy
    Copy link
    Member

    I consider it a bug for *IDLE* to place and size windows so that the bottom of the window is hidden. (If users, perhaps temporarily, move a window down so that the bottom is hidden, that is their business.)

    This is especially bad for the Settings dialog because the Enter and Escape keys are not bound to the Ok and Cancel handlers, as with at least most of the other dialogs. This should be easy to fix.

    The general problem in preventing over-sizing and misplacement is that,
    as far as Tal and I know, tk will only tell us the full size of a particular screen, not the current, usually reduced, view size.

    Until about a month ago, ZoomHeight used platform-specific expressions from long ago that do not, in general, work now. For issue bpo-37039, Tal's solution was to 'calibrate' each screen the first time a window is zoomed on a screen in a session. The window is maximized, the pixel height is saved, and the window is narrowed to what is was. The saved height is used for subsequent zooms. Maximizing works because the OS + tk maximize to the current view size, depending on the current screen settings.

    I suggested then the possibility of IDLE opening with a maximized splash screen. Tal objected that this a) did not solve the problem of multiple screens, and b) would unnecessarily bother people who never zoom. But zoom height is not the only feature that needs this knowledge.

    On my machine with 45 line shell/editor windows, Shell is initially placed too low if I open IDLE one particular way. I'll leave that to another issue.

    For the config dialog, there is a geometry bug independent of the font sample content. Even if the box is cleared, the dialog expands with font size. Fixing this is also a priority.

    To completely solve geometry issues, we again need to know the screen's view height. If not available, we would have to momentarily maximize the dialog as now done with zoom height.

    The height of the Setting dialog is the maximum of the page sizes. For normal font sizes, the font page is the shortest of the first 4, meaning that is has the most extra space. The Highlight and General pages seem to be equally tallest. So adding settings to the latter will increase the minimum size.

    For 3.7.3, the dialog already fills the view height between menu line and icon bar on my Macbook Air. But it is opened a quarter of the way down, so that a quarter of the dialog is covered. This is another geometry bug. On this machine, the dialog should be opened flush up against the app menu. But hard-coding that for all machines would likely annoy most people who do not need that positioning.

    I am worried that the addition of two more items to the General page, for zoom height and line numbers, will make the dialog too tall for the available space. When 3.8.0a3 is released, I will check.

    I am thinking of moving indent size, revised, to the General page and moving Additional Help Sources, possibly flattened a bit, to the Font page. Perhaps we should try to make the pages wider rather than taller.

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jul 25, 2019
    @terryjreedy terryjreedy changed the title IDLE Font Sample distracting and too large IDLE: Fix Font sample (config dialog) geometry Jul 25, 2019
    @terryjreedy terryjreedy added the type-bug An unexpected behavior, bug, or error label Jul 25, 2019
    @taleinat
    Copy link
    Contributor

    Since it's a text widget, it would be simple and rather intuitive to make it scrollable. We could then make its size set according to the size of the config dialog window, rather than the other way around.

    @terryjreedy
    Copy link
    Member

    And maybe a horizontal scroll. In any case, line wrap should be off. Feel free to whip up a minimal change PR that we can merge before Monday.

    @taleinat
    Copy link
    Contributor

    See proposed fix in PR #59163.

    @terryjreedy
    Copy link
    Member

    New changeset 3221a63 by Terry Jan Reedy (Tal Einat) in branch 'master':
    bpo-37628: Fix IDLE config sample sizes (bpo-14958)
    3221a63

    @miss-islington
    Copy link
    Contributor

    New changeset 0242eb3 by Miss Islington (bot) in branch '3.7':
    bpo-37628: Fix IDLE config sample sizes (GH-14958)
    0242eb3

    @miss-islington
    Copy link
    Contributor

    New changeset 1710193 by Miss Islington (bot) in branch '3.8':
    bpo-37628: Fix IDLE config sample sizes (GH-14958)
    1710193

    @aeros
    Copy link
    Contributor

    aeros commented Jul 27, 2019

    After PR-14958 was merged, I tested the latest development version of CPython on Arch Linux 5.2.3 and I can confirm that the "Settings" window no longer scales past the edge of the screen. Instead, the window size remains fixed and the scroll area dynamically changes to allow for preview of the enlarged font sample. To make sure it worked for all of the fonts, I scrolled the list of font faces with a size setting of 40 (as well as some other sizes, but not every possible combination). The window size remained the same and the "Font Sample" preview scaled dynamically with the scrollbar in every instance.

    This recent round of recent updates to the IDLE have added some fantastic QoL changes, nicely done taleinat and terry!

    @aeros
    Copy link
    Contributor

    aeros commented Jul 27, 2019

    Correction: By "scroll the list of fonts" I meant that I went through all of them by holding the down arrow from the top of the list (Adobe Courier - Z003), scrolling through the list wouldn't accomplish anything. I did that starting with a font size 40 and a few other ones.

    @taleinat
    Copy link
    Contributor

    Terry, thanks for reviewing, helping get this fully ready, and merging.

    Kyle, thanks for the kind feedback, it's truly heart-warming!

    @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 3.8 only security fixes 3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants