IDLE: Fix Font sample (config dialog) geometry #81809
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
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'
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']
The text was updated successfully, but these errors were encountered:
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.
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,
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.
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!
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.