diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2024-02-23 02:15:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 02:15:39 (GMT) |
commit | b48101864c724a7eab41a6878a836f38e54e04fb (patch) | |
tree | 3160877dd8d78e1ef422fbea82f34b34b1da03b7 /Lib | |
parent | 4ee6bdfbaa792a3aa93c65c2022a89bd2d1e0894 (diff) | |
download | cpython-b48101864c724a7eab41a6878a836f38e54e04fb.zip cpython-b48101864c724a7eab41a6878a836f38e54e04fb.tar.gz cpython-b48101864c724a7eab41a6878a836f38e54e04fb.tar.bz2 |
gh-88516: show file proxy icon in IDLE editor windows on macOS (#112894)
The platform standard on macOS is to show a proxy icon for open
files in the titlebar of Windows. Make sure IDLE matches this
behaviour.
Don't use both the long and short names in the window title.
The behaviour of other editors (such as Text Editor) is to show
only the short name with the proxy icon.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/editor.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 8ee8eba..7bfa093 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -1044,7 +1044,9 @@ class EditorWindow: def saved_change_hook(self): short = self.short_title() long = self.long_title() - if short and long: + if short and long and not macosx.isCocoaTk(): + # Don't use both values on macOS because + # that doesn't match platform conventions. title = short + " - " + long + _py_version elif short: title = short @@ -1059,6 +1061,13 @@ class EditorWindow: self.top.wm_title(title) self.top.wm_iconname(icon) + if macosx.isCocoaTk(): + # Add a proxy icon to the window title + self.top.wm_attributes("-titlepath", long) + + # Maintain the modification status for the window + self.top.wm_attributes("-modified", not self.get_saved()) + def get_saved(self): return self.undo.get_saved() |