classification
Title: IDLE: Fix Font sample (config dialog) geometry
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: aeros, miss-islington, rhettinger, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2019-07-19 07:32 by rhettinger, last changed 2019-07-28 06:00 by taleinat. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14958 merged taleinat, 2019-07-26 12:50
PR 14980 merged miss-islington, 2019-07-27 16:58
PR 14981 merged miss-islington, 2019-07-27 16:58
Messages (11)
msg348150 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-07-19 07:32
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.
msg348460 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-07-25 23:56
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 #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.
msg348464 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-07-26 05:50
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.
msg348476 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-07-26 07:25
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.
msg348488 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-07-26 12:51
See proposed fix in PR GH-14958.
msg348549 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-07-27 16:58
New changeset 3221a63c69268a9362802371a616f49d522a5c4f by Terry Jan Reedy (Tal Einat) in branch 'master':
bpo-37628: Fix IDLE config sample sizes (#14958)
https://github.com/python/cpython/commit/3221a63c69268a9362802371a616f49d522a5c4f
msg348550 - (view) Author: miss-islington (miss-islington) Date: 2019-07-27 17:14
New changeset 0242eb3fa7818eb078c0915a4b844c5a2070b810 by Miss Islington (bot) in branch '3.7':
bpo-37628: Fix IDLE config sample sizes (GH-14958)
https://github.com/python/cpython/commit/0242eb3fa7818eb078c0915a4b844c5a2070b810
msg348551 - (view) Author: miss-islington (miss-islington) Date: 2019-07-27 17:19
New changeset 171019354aa2c717af2e7b2c90aec7b9724f7282 by Miss Islington (bot) in branch '3.8':
bpo-37628: Fix IDLE config sample sizes (GH-14958)
https://github.com/python/cpython/commit/171019354aa2c717af2e7b2c90aec7b9724f7282
msg348560 - (view) Author: Kyle Stanley (aeros) * (Python triager) Date: 2019-07-27 18:40
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!
msg348561 - (view) Author: Kyle Stanley (aeros) * (Python triager) Date: 2019-07-27 18:46
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.
msg348572 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-07-28 06:00
Terry, thanks for reviewing, helping get this fully ready, and merging.

Kyle, thanks for the kind feedback, it's truly heart-warming!
History
Date User Action Args
2019-07-28 06:00:06taleinatsetstatus: open -> closed
resolution: fixed
messages: + msg348572

stage: patch review -> resolved
2019-07-27 18:46:30aerossetmessages: + msg348561
2019-07-27 18:40:54aerossetnosy: + aeros
messages: + msg348560
2019-07-27 17:19:15miss-islingtonsetmessages: + msg348551
2019-07-27 17:14:57miss-islingtonsetnosy: + miss-islington
messages: + msg348550
2019-07-27 16:58:55miss-islingtonsetpull_requests: + pull_request14748
2019-07-27 16:58:12terry.reedysetmessages: + msg348549
2019-07-27 16:58:06miss-islingtonsetpull_requests: + pull_request14747
2019-07-26 12:51:36taleinatsetmessages: + msg348488
2019-07-26 12:50:58taleinatsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request14726
2019-07-26 07:25:27terry.reedysetmessages: + msg348476
2019-07-26 05:50:13taleinatsetmessages: + msg348464
2019-07-25 23:56:52terry.reedysetversions: + Python 3.7
type: behavior

nosy: + taleinat
title: IDLE Font Sample distracting and too large -> IDLE: Fix Font sample (config dialog) geometry
messages: + msg348460
stage: needs patch
2019-07-19 07:32:32rhettingercreate