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: make editor title bar user configurable #65787
Comments
python/cpython#61592 changes the title bars for (so far), shell and editor windows. While the editor window change helps me (for reasons given on the issue) and got no objection, before being pushed, from people nosy on the issue, others have found it objectionable in practice. Since no one solution satisfies all use cases, I propose to make the editor_title format user configurable. Since extra keywords are ignored, as in
>>> "{short}".format(short='abc', long='xyz')
'abc'
users can omit and arrange fields as they please in editor_title, which would then be called with all 3 variable field values.
editor_title.format(short=short, long=long, version=version)
I believe editor_title = '{short} - {long}' produces the previous title. That can be the default. A complication is that EditorWindow is also the base window class for Shell and Output windows. The title is calculated and set in a generic Some other possible solutions: Add parameter editor=False to saved_change_hook. Make EditorWindow a subclass of a generic Base Editor and move things specific to EditorWindow to the subclass. |
Another possibility is to separate the calculation of the title from setting it. This would make it much easier to unittest the calculation of the title. |
Attaching a patch to make title bar user configurable. In this patch
These parameters are configurable by going to "options"->"configure idle"->"general tab"->"configure" The fetching of title is done by a utility function called get_title. Default config titles for PyShellEditorWindow, PyShell and OutputWindow have been inserted into config-main.def. This is based on my preferences. It may be very different from what the community/idle userbase requires. These settings have to be changed to suit the tastes of community/idle userbase. A new module called configTitle. This contains a getTitleDialog class. It is modeled along the lines of cfgSectionNameDialog and cfgSectionHelpSourceEdit dialog. In configDialog.py,in "general tab", a new section for configuring title bar has been added. Clicking "configure" brings up a "getTitleDialog" dialog, where the user can modify the title. A simple validity check is also performed. As best possible, the GUI additions are in close sync with the existing code around it(except in ConfigureTitleBar). And to whats missing,
|
I decided that it would be better to try to quickly solve Raymond's issue with editor windows in a simpler fashion and not rush this. Once we add a new configuration option, the cross-version nature of user config files means we are more or less stuck with the decision. I agree that the current title code is hackish and should be refactored somehow. I am just not sure how yet. I want to take the in-process CheckerWindows and future ExternalWindows into account too. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: