From: Terry Jan Reedy Date: Sat, 8 Feb 2014 14:39:51 +0000 (-0500) Subject: Issue #20406: Use Python application icons for Idle window title bars. X-Git-Tag: v2.7.8~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ade2d25fc585876540ac9d591a44469fd853462;p=python Issue #20406: Use Python application icons for Idle window title bars. Patch mostly by Serhiy Storchaka. --- diff --git a/Lib/idlelib/Icons/idle.ico b/Lib/idlelib/Icons/idle.ico new file mode 100644 index 0000000000..3357aef148 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 index 0000000000..9f001b1d79 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 index 0000000000..6abde0af90 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 index 0000000000..af5b2d52cc 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 index 0000000000..41b70dbc37 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 index 0000000000..fc5304f31e 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 index 0000000000..e5fa9280e2 Binary files /dev/null and b/Lib/idlelib/Icons/idle_48.png differ diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index dc3cfe6120..a424751f1c 100755 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -15,7 +15,7 @@ import io import linecache from code import InteractiveInterpreter -from platform import python_version +from platform import python_version, system try: from Tkinter import * @@ -1536,6 +1536,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.tk.call('wm', 'iconphoto', str(root), "-default", *icons) + fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) diff --git a/Misc/NEWS b/Misc/NEWS index 9479ded78a..5bf0af121b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -211,6 +211,9 @@ Tools/Demos IDLE ---- +- Issue #20406: Use Python application icons for Idle window title bars. + Patch mostly by Serhiy Storchaka. + - Issue #17721: Remove non-functional configuration dialog help button until we make it actually gives some help when clicked. Patch by Guilherme Simões.