This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: IDLE: Improve config dialog font change user interface
Type: enhancement Stage: needs patch
Components: IDLE Versions: Python 3.8, Python 3.7
Status: open Resolution:
Dependencies: 27755 30870 30981 Superseder:
Assigned To: terry.reedy Nosy List: markroseman, rhettinger, terry.reedy
Priority: normal Keywords:

Created on 2015-08-01 21:12 by rhettinger, last changed 2022-04-11 14:58 by admin.

File name Uploaded Description Edit
cfg_font_layout.png markroseman, 2015-08-02 18:50 Alternative layout for font/tabs page
Messages (10)
msg247829 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-08-01 21:12
A recurring issue with students using IDLE is the user interface for the fonts and tabs preference settings.

* The default setting of 4 space tabs is a good default, but the giant slider cries out to be moved (usually when people are intending to increase their font size).  A slider was not a good choice.  It should use something like what is currently used for font size.

* On the other hand, the font size would benefit from have a slider.

* I don't know if anything can be done to improve the selection of the font face.  The scrolling menu of choices worked great back when we only had a handful of choices but it had grown problematic with a large number of choices.  It is a bit of a struggle to select Menlo on a Mac if you already know what you want.
msg247846 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-02 01:11
I agree that this tab needs an overhall.
Existing issues would be part of this:
17642 Font resizing hot keys (not sure about this)
14440 Use multiple alphabets in example (definitely)

Other ideas that I remember:
* Enlarge dialog box as needed (it already expands horizontally with big fonts).
* Put indent box across top with unobtrusive spinbox or pulldown box to right.
* For font names, use the same sort of listbox as used with completions, where one can type initial chars of name in entry box and selection bar moves down to first entry that matches. 
* Put example box to right of selection box.
msg247887 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-02 18:50
What do you think of the layout in cfg_font_layout.png? (before/after)
msg248709 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-17 02:48
The side-by-side part I obviously like, but I think we need to keep 'Base Editor Font' since this and only this is affected by the selection.  I think there should be an option to increase the 'other' font used for everything else.
msg248719 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-08-17 07:06
FWIW, I would also like a pair of hotkeys, Cmd + and Cmd - to increase and decrease the font (this would greatly improve usability for font size changes).   There is good precedent for this in other editors and terminal programs.
msg248739 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-17 17:19
Agree about the font resizing menu items/shortcuts... your original #17642 remains open for this
msg248740 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-08-17 17:46
I agree. Cntl/Cmd +/- font sizing works in turtledemo within sensible limits. The code could be copied.
msg298092 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-10 22:05
Make this the master issue for improving the font tab user interface by improving components and rearranging them.  With basic tests done, I am moving this up in priority.

Related issues currently open.
#30870 (dependency) made Up/Down change font selection; unit test needed.
#27755 replaces IDLE's custom DynOptionMenu with ttk.Combobox.  Comboboxes allow key entry of a value and the arrow toggles. See msg298091 for comparison and evaluation for font page.
#13802 (dependency) is about the improving the sample display.
#17642 is about font resizing by hot key and wheel in editor.
#20917 is about the font change notification system.

Additional changes for this issue or new related issues.

* Selecting a font by name (as well as a font size by number) can be done with an entry box with a validator linked to the listbox.  If a ttk Combobox can be locked open, I would try that.  See #27755.  For a demo of another alternative, run the tk fontchooser.

import tkinter
root = tkinter.Tk()'tk', 'fontchooser', 'show')

For IDLE, I like some parts, not others.  I view it as an alternate mockup for ideas to build on.

* Mark's mockup removes "Base Editor Font".  If an editor window can have its font individually resized, then the settings on the font page define just that.  'Font Size' would then have to be 'Starting [or Default] Font Size'. 

* Font size a slider?  I am not convinced.  It would have to be vertical to go up to 40.  (I added larger sizes by request for classroom projector use.)  On the other hand, it would allow any size in the given range.  A spinbox that could be spun by mousewheel would also and stay compact.  Or use a ttk Combobox.

* See #13802 for discussion of sample display.

* Indent.  I don't understand "cries out to be moved (usually when people are intending to increase their font size)."  But I think it take too much space and should be shrunk to a spin box or drop box.  Reduced to a single line, I am thinking of moving it to the General tab, or perhaps a new Editor tab.  It does not particularly belong with font selection.

* Factor the Font page, with associated Variables and their tracers, other attributes, and methods, into a FontPage class.
msg298763 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-21 02:37
I decided to rearrange page #24776 before changing sample #13802.
msg334281 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-01-24 05:52
I now think that the proper widget for font resizing might be a ttk.Spinbox (but see below).  #33962 discusses issues around using this widget. 

#33397 is about adding local font resizing with hot key or mousewheel to text and help viewers via a new FontSizer class. Font Sizer should be usable with the sample Text instance.  Size changes in the sample should propagate to the size widget.  When done, it might suffice to use a simple entry box for font size.  We already use them for counts on the General tab.

Since we do not want to encourage indent changes, I think the indent widget should be an entry box with bounds check.
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68964
2019-01-24 05:53:06terry.reedysetversions: + Python 3.8, - Python 3.6
2019-01-24 05:52:47terry.reedysetmessages: + msg334281
2017-10-12 05:07:53terry.reedyunlinkissue13802 dependencies
2017-07-21 02:37:00terry.reedysetdependencies: + IDLE: Test config dialog font bold button and sample change, - IDLE font settings: use multiple character sets in examples
messages: + msg298763
2017-07-21 02:36:44terry.reedylinkissue13802 dependencies
2017-07-10 22:05:15terry.reedysetpriority: low -> normal
versions: + Python 3.7, - Python 3.5
title: Improve Fonts/Tabs UX for IDLE -> IDLE: Improve config dialog font change user interface
messages: + msg298092

dependencies: + IDLE font settings: use multiple character sets in examples, Retire DynOptionMenu with a ttk Combobox, IDLE: configdialog/fonts: change font when select by key up/down
2015-08-17 17:46:53terry.reedysetmessages: + msg248740
2015-08-17 17:19:01markrosemansetmessages: + msg248739
2015-08-17 07:06:43rhettingersetmessages: + msg248719
2015-08-17 02:48:10terry.reedysetmessages: + msg248709
2015-08-02 18:50:38markrosemansetfiles: + cfg_font_layout.png

messages: + msg247887
2015-08-02 01:11:49terry.reedysetnosy: + markroseman

messages: + msg247846
versions: + Python 3.5
2015-08-01 21:12:47rhettingercreate