]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #20406: Use Python application icons for Idle window title bars.
authorTerry Jan Reedy <tjreedy@udel.edu>
Sat, 8 Feb 2014 14:02:26 +0000 (09:02 -0500)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sat, 8 Feb 2014 14:02:26 +0000 (09:02 -0500)
Patch mostly by Serhiy Storchaka.

Lib/idlelib/Icons/idle.ico [new file with mode: 0644]
Lib/idlelib/Icons/idle_16.gif [new file with mode: 0644]
Lib/idlelib/Icons/idle_16.png [new file with mode: 0644]
Lib/idlelib/Icons/idle_32.gif [new file with mode: 0644]
Lib/idlelib/Icons/idle_32.png [new file with mode: 0644]
Lib/idlelib/Icons/idle_48.gif [new file with mode: 0644]
Lib/idlelib/Icons/idle_48.png [new file with mode: 0644]
Lib/idlelib/PyShell.py
Misc/NEWS

diff --git a/Lib/idlelib/Icons/idle.ico b/Lib/idlelib/Icons/idle.ico
new file mode 100644 (file)
index 0000000..3357aef
Binary files /dev/null and b/Lib/idlelib/Icons/idle.ico differ
diff --git a/Lib/idlelib/Icons/idle_16.gif b/Lib/idlelib/Icons/idle_16.gif
new file mode 100644 (file)
index 0000000..9f001b1
Binary files /dev/null and b/Lib/idlelib/Icons/idle_16.gif differ
diff --git a/Lib/idlelib/Icons/idle_16.png b/Lib/idlelib/Icons/idle_16.png
new file mode 100644 (file)
index 0000000..6abde0a
Binary files /dev/null and b/Lib/idlelib/Icons/idle_16.png differ
diff --git a/Lib/idlelib/Icons/idle_32.gif b/Lib/idlelib/Icons/idle_32.gif
new file mode 100644 (file)
index 0000000..af5b2d5
Binary files /dev/null and b/Lib/idlelib/Icons/idle_32.gif differ
diff --git a/Lib/idlelib/Icons/idle_32.png b/Lib/idlelib/Icons/idle_32.png
new file mode 100644 (file)
index 0000000..41b70db
Binary files /dev/null and b/Lib/idlelib/Icons/idle_32.png differ
diff --git a/Lib/idlelib/Icons/idle_48.gif b/Lib/idlelib/Icons/idle_48.gif
new file mode 100644 (file)
index 0000000..fc5304f
Binary files /dev/null and b/Lib/idlelib/Icons/idle_48.gif differ
diff --git a/Lib/idlelib/Icons/idle_48.png b/Lib/idlelib/Icons/idle_48.png
new file mode 100644 (file)
index 0000000..e5fa928
Binary files /dev/null and b/Lib/idlelib/Icons/idle_48.png differ
index 55fd3574d4f13fca0663f063373fc6226ce6d021..2e5ebb233b85b76d6965c079e8de6bf5b5e8d52b 100755 (executable)
@@ -16,7 +16,7 @@ import io
 
 import linecache
 from code import InteractiveInterpreter
-from platform import python_version
+from platform import python_version, system
 
 try:
     from tkinter import *
@@ -1524,6 +1524,18 @@ def main():
     # start editor and/or shell windows:
     root = Tk(className="Idle")
 
+    # set application icon
+    icondir = os.path.join(os.path.dirname(__file__), 'Icons')
+    if system() == 'Windows':
+        iconfile = os.path.join(icondir, 'idle.ico')
+        root.wm_iconbitmap(default=iconfile)
+    elif TkVersion >= 8.5:
+        ext = '.png' if TkVersion >= 8.6 else '.gif'
+        iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext))
+                     for size in (16, 32, 48)]
+        icons = [PhotoImage(file=iconfile) for iconfile in iconfiles]
+        root.wm_iconphoto(True, *icons)
+
     fixwordbreaks(root)
     root.withdraw()
     flist = PyShellFileList(root)
index f3f94bfb836ab42869815ed6d24ef4fcf255c037..ae5f83a153765a48b8103fd9d4acda7afbe29ff6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -316,6 +316,9 @@ Library
 IDLE
 ----
 
+- Issue #20406: Use Python application icons for Idle window title bars.
+  Patch mostly by Serhiy Storchaka.
+
 - Update the python.gif icon for the Idle classbrowser and pathbowser
   from the old green snake to the new new blue and yellow snakes.